add initial symbols to config and checks to check_config to allow use of macros to define standard functions

This commit is contained in:
Rich Evans 2015-02-03 11:26:31 +00:00
parent 98081c5ec6
commit 4cc8a22d88
2 changed files with 92 additions and 0 deletions

View File

@ -198,14 +198,65 @@
#error "POLARSSL_PKCS11_C defined, but not all prerequisites" #error "POLARSSL_PKCS11_C defined, but not all prerequisites"
#endif #endif
#if defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) &&\
!defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS defined, but not prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_EXIT_ALT) && !defined(POLARSSL_PLATFORM_C) #if defined(POLARSSL_PLATFORM_EXIT_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_EXIT_ALT defined, but not all prerequisites" #error "POLARSSL_PLATFORM_EXIT_ALT defined, but not all prerequisites"
#endif #endif
#if defined(POLARSSL_PLATFORM_EXIT_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_EXIT_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_EXIT) ||\
defined(POLARSSL_PLATFORM_EXIT_ALT) )
#error "POLARSSL_PLATFORM_EXIT_MACRO and POLARSSL_PLATFORM_STD_EXIT/POLARSSL_PLATFORM_EXIT_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_FPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C) #if defined(POLARSSL_PLATFORM_FPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" #error "POLARSSL_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
#endif #endif
#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_FPRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_FPRINTF) ||\
defined(POLARSSL_PLATFORM_FPRINTF_ALT) )
#error "POLARSSL_PLATFORM_FPRINTF_MACRO and POLARSSL_PLATFORM_STD_FPRINTF/POLARSSL_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_FREE_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_FREE_MACRO) &&\
defined(POLARSSL_PLATFORM_STD_FREE)
#error "POLARSSL_PLATFORM_FREE_MACRO and POLARSSL_PLATFORM_STD_FREE cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) || !defined(POLARSSL_PLATFORM_MEMORY) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_MALLOC_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_MALLOC_MACRO) &&\
defined(POLARSSL_PLATFORM_STD_MALLOC)
#error "POLARSSL_PLATFORM_MALLOC_MACRO and POLARSSL_PLATFORM_STD_MALLOC cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_MEMORY) && !defined(POLARSSL_PLATFORM_C) #if defined(POLARSSL_PLATFORM_MEMORY) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_MEMORY defined, but not all prerequisites" #error "POLARSSL_PLATFORM_MEMORY defined, but not all prerequisites"
#endif #endif
@ -214,6 +265,18 @@
#error "POLARSSL_PLATFORM_PRINTF_ALT defined, but not all prerequisites" #error "POLARSSL_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
#endif #endif
#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_PRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_PRINTF) ||\
defined(POLARSSL_PLATFORM_PRINTF_ALT) )
#error "POLARSSL_PLATFORM_PRINTF_MACRO and POLARSSL_PLATFORM_STD_PRINTF/POLARSSL_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C) #if defined(POLARSSL_PLATFORM_SNPRINTF_ALT) && !defined(POLARSSL_PLATFORM_C)
#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" #error "POLARSSL_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
#endif #endif
@ -223,6 +286,18 @@
#error "POLARSSL_PLATFORM_SNPRINTF_ALT defined but not available on Windows" #error "POLARSSL_PLATFORM_SNPRINTF_ALT defined but not available on Windows"
#endif #endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) &&\
( !defined(POLARSSL_PLATFORM_C) ||\
!defined(POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS) )
#error "POLARSSL_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
#endif
#if defined(POLARSSL_PLATFORM_SNPRINTF_MACRO) &&\
( defined(POLARSSL_PLATFORM_STD_SNPRINTF) ||\
defined(POLARSSL_PLATFORM_SNPRINTF_ALT) )
#error "POLARSSL_PLATFORM_SNPRINTF_MACRO and POLARSSL_PLATFORM_STD_SNPRINTF/POLARSSL_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
#endif
#if defined(POLARSSL_PLATFORM_STD_MEM_HDR) &&\ #if defined(POLARSSL_PLATFORM_STD_MEM_HDR) &&\
!defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS) !defined(POLARSSL_PLATFORM_NO_STD_FUNCTIONS)
#error "POLARSSL_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" #error "POLARSSL_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"

View File

@ -147,6 +147,16 @@
*/ */
//#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS //#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS
/**
* \def POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS
*
* TO-DO: ADD DESCRIPTION & ANY WARNINGS ETC
*
* Requires: POLARSSL_PLATFORM_C
*
*/
//#define POLARSSL_PLATFORM_ENABLE_FUNCTION_MACROS
/** /**
* \def POLARSSL_PLATFORM_XXX_ALT * \def POLARSSL_PLATFORM_XXX_ALT
* *
@ -2248,6 +2258,13 @@
//#define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ //#define POLARSSL_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */
//#define POLARSSL_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ //#define POLARSSL_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */
//#define POLARSSL_PLATFORM_MALLOC_MACRO malloc /**< Default allocator macro to use, can be undefined */
//#define POLARSSL_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */
//#define POLARSSL_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */
//#define POLARSSL_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */
//#define POLARSSL_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */
//#define POLARSSL_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */
/* SSL Cache options */ /* SSL Cache options */
//#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ //#define SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */
//#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ //#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */