Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
00033 #define _INCLUDE_SOURCEMOD_PLATFORM_H_
00034
00035
00036
00037
00038
00039
00040 #if defined WIN32 || defined WIN64
00041 #ifndef PLATFORM_WINDOWS
00042 #define PLATFORM_WINDOWS
00043 #endif
00044 #if !defined WIN32_LEAN_AND_MEAN
00045 #define WIN32_LEAN_AND_MEAN
00046 #endif
00047 #if !defined snprintf
00048 #define snprintf _snprintf
00049 #endif
00050 #if !defined stat
00051 #define stat _stat
00052 #endif
00053 #define strcasecmp strcmpi
00054 #define strncasecmp strnicmp
00055 #include <windows.h>
00056 #include <direct.h>
00057 #define PLATFORM_LIB_EXT "dll"
00058 #define PLATFORM_MAX_PATH MAX_PATH
00059 #define PLATFORM_SEP_CHAR '\\'
00060 #define PLATFORM_SEP_ALTCHAR '/'
00061 #define PLATFORM_EXTERN_C extern "C" __declspec(dllexport)
00062 #if defined _MSC_VER && _MSC_VER >= 1400
00063 #define SUBPLATFORM_SECURECRT
00064 #endif
00065 #elif defined __linux__ || defined __APPLE__
00066 #if defined __linux__
00067 # define PLATFORM_LINUX
00068 # define PLATFORM_LIB_EXT "so"
00069 #elif defined __APPLE__
00070 # define PLATFORM_APPLE
00071 # define PLATFORM_LIB_EXT "dylib"
00072 #endif
00073 #define PLATFORM_POSIX
00074 #include <errno.h>
00075 #include <unistd.h>
00076 #include <dirent.h>
00077 #include <dlfcn.h>
00078 #include <sys/stat.h>
00079 #if defined PLATFORM_APPLE
00080 #include <sys/syslimits.h>
00081 #endif
00082 #define PLATFORM_MAX_PATH PATH_MAX
00083 #define PLATFORM_SEP_CHAR '/'
00084 #define PLATFORM_SEP_ALTCHAR '\\'
00085 #define PLATFORM_EXTERN_C extern "C" __attribute__((visibility("default")))
00086 #endif
00087
00088 #if !defined SOURCEMOD_BUILD
00089 #define SOURCEMOD_BUILD
00090 #endif
00091
00092 #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_
00093