eapol/eapol_framework/eapol_common/am/include/eap_am_memory.h
changeset 49 43351a4f2da3
parent 26 9abfd4f00d37
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    39 #if defined(DMALLOC) || defined(USE_EAP_MEMORY_FUNCTIONS)
    39 #if defined(DMALLOC) || defined(USE_EAP_MEMORY_FUNCTIONS)
    40 
    40 
    41 	#include "eap_tools.h"
    41 	#include "eap_tools.h"
    42 	#include "eap_variable_data.h"
    42 	#include "eap_variable_data.h"
    43 	#include "eap_am_export.h"
    43 	#include "eap_am_export.h"
       
    44 // Start: added by script change_export_macros.sh.
       
    45 #if defined(EAP_NO_EXPORT_EAP_AM_MEMORY_H)
       
    46 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_H EAP_NONSHARABLE 
       
    47 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_H 
       
    48 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H 
       
    49 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_H 
       
    50 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_H 
       
    51 #elif defined(EAP_EXPORT_EAP_AM_MEMORY_H)
       
    52 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_H EAP_EXPORT 
       
    53 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_H EAP_FUNC_EXPORT 
       
    54 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H EAP_C_FUNC_EXPORT 
       
    55 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_H EAP_FUNC_EXPORT 
       
    56 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_H EAP_C_FUNC_EXPORT 
       
    57 #else
       
    58 	#define EAP_CLASS_VISIBILITY_EAP_AM_MEMORY_H EAP_IMPORT 
       
    59 	#define EAP_FUNC_VISIBILITY_EAP_AM_MEMORY_H EAP_FUNC_IMPORT 
       
    60 	#define EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H EAP_C_FUNC_IMPORT 
       
    61 	#define EAP_FUNC_EXPORT_EAP_AM_MEMORY_H 
       
    62 	#define EAP_C_FUNC_EXPORT_EAP_AM_MEMORY_H 
       
    63 #endif
       
    64 // End: added by script change_export_macros.sh.
    44 
    65 
    45 
    66 
    46 	#if defined(USE_EAP_MEMORY_FUNCTIONS_FAILURES)
    67 	#if defined(USE_EAP_MEMORY_FUNCTIONS_FAILURES)
    47 
    68 
    48 		void g_eap_set_memory_parameters(
    69 		void g_eap_set_memory_parameters(
    82 
   103 
    83 	#if defined(_WIN32)	|| defined(__GNUC__)
   104 	#if defined(_WIN32)	|| defined(__GNUC__)
    84 		/*
   105 		/*
    85 		 * An overload function the malloc.
   106 		 * An overload function the malloc.
    86 		 */
   107 		 */
    87 		EAP_C_FUNC_IMPORT void *jph_malloc(size_t n);
   108 		EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_malloc(size_t n);
    88 
   109 
    89 		/*
   110 		/*
    90 		 * An overload function the malloc.
   111 		 * An overload function the malloc.
    91 		 */
   112 		 */
    92 		EAP_C_FUNC_IMPORT void *jph_malloc_ex(size_t n, const char *file, int line);
   113 		EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_malloc_ex(size_t n, const char *file, int line);
    93 
   114 
    94 		#if defined(USE_JPH_REALLOC)
   115 		#if defined(USE_JPH_REALLOC)
    95 			/*
   116 			/*
    96 			 * An overload function the realloc.
   117 			 * An overload function the realloc.
    97 			 */
   118 			 */
    98 			EAP_C_FUNC_IMPORT void *jph_realloc(void *oldbuf, size_t n);
   119 			EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_realloc(void *oldbuf, size_t n);
    99 
   120 
   100 			/*
   121 			/*
   101 			 * An overload function the realloc.
   122 			 * An overload function the realloc.
   102 			 */
   123 			 */
   103 			EAP_C_FUNC_IMPORT void *jph_realloc_ex(void *oldbuf, size_t n, const char *file, int line);
   124 			EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_realloc_ex(void *oldbuf, size_t n, const char *file, int line);
   104 		#endif //#if defined(USE_JPH_REALLOC)
   125 		#endif //#if defined(USE_JPH_REALLOC)
   105 
   126 
   106 		#if defined(USE_JPH_CALLOC)
   127 		#if defined(USE_JPH_CALLOC)
   107 			/*
   128 			/*
   108 			 * An overload function the calloc.
   129 			 * An overload function the calloc.
   109 			 */
   130 			 */
   110 			EAP_C_FUNC_IMPORT void *jph_calloc(size_t count, size_t size);
   131 			EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_calloc(size_t count, size_t size);
   111 		#endif //#if defined(USE_JPH_CALLOC)
   132 		#endif //#if defined(USE_JPH_CALLOC)
   112 
   133 
   113 		/*
   134 		/*
   114 		 * An overload function for the free.
   135 		 * An overload function for the free.
   115 		 */
   136 		 */
   116 		EAP_C_FUNC_IMPORT void jph_free(void *cp);
   137 		EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void jph_free(void *cp);
   117 
   138 
   118 
   139 
   119 		EAP_C_FUNC_IMPORT void *jph_new(size_t n);
   140 		EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void *jph_new(size_t n);
   120 
   141 
   121 		EAP_C_FUNC_IMPORT void jph_delete(void *cp);
   142 		EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H void jph_delete(void *cp);
   122 
   143 
   123 	#endif /* #if defined(_WIN32) */
   144 	#endif /* #if defined(_WIN32) */
   124 
   145 
   125 	#if defined(__cplusplus) || defined(__cc)
   146 	#if defined(__cplusplus) || defined(__cc)
   126 	}
   147 	}
   174 		#endif //#if defined(WIN32)
   195 		#endif //#if defined(WIN32)
   175 
   196 
   176 
   197 
   177 		#if defined(unix)
   198 		#if defined(unix)
   178 			typedef int (*jph_new_handler) (size_t);
   199 			typedef int (*jph_new_handler) (size_t);
   179 			EAP_C_FUNC_IMPORT jph_new_handler jph_set_new_handler(jph_new_handler);
   200 			EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H jph_new_handler jph_set_new_handler(jph_new_handler);
   180 		#elif defined(_WIN32) && !defined(__GNUC__)
   201 		#elif defined(_WIN32) && !defined(__GNUC__)
   181 			typedef int (__cdecl * jph_new_handler) (size_t);
   202 			typedef int (__cdecl * jph_new_handler) (size_t);
   182 			EAP_C_FUNC_IMPORT jph_new_handler __cdecl jph_set_new_handler(jph_new_handler);
   203 			EAP_C_FUNC_VISIBILITY_EAP_AM_MEMORY_H jph_new_handler __cdecl jph_set_new_handler(jph_new_handler);
   183 		#else
   204 		#else
   184 			// Not supported in Symbian.
   205 			// Not supported in Symbian.
   185 		#endif
   206 		#endif
   186 
   207 
   187 
   208