libisdn
Q9XXplatform.h
Go to the documentation of this file.
00001 /*
00002  * cross-platform macros
00003  */
00004 #ifndef _Q9XX_PLATFORM_H_
00005 #define _Q9XX_PLATFORM_H_
00006 
00007 #if defined(Q931_PRIVATE) || defined(Q921_PRIVATE)
00008 /*
00009  * Private view
00010  */
00011 
00012 /*
00013  * Win32 MSVC
00014  */
00015 #if defined(_MSC_VER)
00016 #pragma warning(disable:4100)
00017 #ifndef __inline__
00018 #define __inline__ __inline
00019 #endif
00020 #if (_MSC_VER >= 1400)                  /* VC8+ */
00021 #ifndef _CRT_SECURE_NO_DEPRECATE
00022 #define _CRT_SECURE_NO_DEPRECATE
00023 #endif
00024 #ifndef _CRT_NONSTDC_NO_DEPRECATE
00025 #define _CRT_NONSTDC_NO_DEPRECATE
00026 #endif
00027 #endif /* _MSC_VER >= 1400 */
00028 #ifndef strcasecmp
00029 #define strcasecmp(s1, s2) _stricmp(s1, s2)
00030 #endif
00031 #ifndef strncasecmp
00032 #define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
00033 #endif
00034 #ifndef snprintf
00035 #define snprintf _snprintf
00036 #endif
00037 #define PLATFORM_WIN32 1
00038 #endif /* _MSC_VER */
00039 
00040 #if defined(PLATFORM_WIN32)
00041 #if !defined(HAVE_RANDOM)
00042 #define random rand
00043 #endif
00044 #endif
00045 
00046 /*
00047  * Compiler specific
00048  */
00049 #if defined(__GNUC__)
00050 #define Q921_API        __attribute__((visibility("default")))
00051 #define Q931_API        __attribute__((visibility("default")))
00052 
00053 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
00054 #define Q921_API        __attribute__((visibility("default")))
00055 #define Q931_API        __attribute__((visibility("default")))
00056 
00057 #elif defined(_MSC_VER)
00058 #define Q921_API        __declspec(dllexport) __stdcall
00059 #define Q931_API        __declspec(dllexport) __stdcall
00060 
00061 #else
00062 #define Q921_API
00063 #define Q931_API
00064 #endif
00065 
00066 #else   /* !Q931_PRIVATE */
00067 /*
00068  * Public view
00069  */
00070 #define Q921_API
00071 #define Q931_API
00072 
00073 #endif
00074 #endif