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 #define PLATFORM_WINDOWS
00042 #if !defined WIN32_LEAN_AND_MEAN
00043 #define WIN32_LEAN_AND_MEAN
00044 #endif
00045 #if !defined snprintf
00046 #define snprintf _snprintf
00047 #endif
00048 #if !defined stat
00049 #define stat _stat
00050 #endif
00051 #define strcasecmp strcmpi
00052 #define strncasecmp strnicmp
00053 #include <windows.h>
00054 #include <direct.h>
00055 #define PLATFORM_LIB_EXT "dll"
00056 #define PLATFORM_MAX_PATH MAX_PATH
00057 #define PLATFORM_SEP_CHAR '\\'
00058 #define PLATFORM_SEP_ALTCHAR '/'
00059 #define PLATFORM_EXTERN_C extern "C" __declspec(dllexport)
00060 #if defined _MSC_VER && _MSC_VER >= 1400
00061 #define SUBPLATFORM_SECURECRT
00062 #endif
00063 #elif defined __linux__ || defined __APPLE__
00064 #if defined __linux__
00065 # define PLATFORM_LINUX
00066 #elif defined __APPLE__
00067 # define PLATFORM_APPLE
00068 #endif
00069 #define PLATFORM_POSIX
00070 #include <errno.h>
00071 #include <unistd.h>
00072 #include <dirent.h>
00073 #include <dlfcn.h>
00074 #include <sys/stat.h>
00075 #if defined PLATFORM_APPLE
00076 #include <sys/syslimits.h>
00077 #endif
00078 #define PLATFORM_MAX_PATH PATH_MAX
00079 #define PLATFORM_LIB_EXT "so"
00080 #define PLATFORM_SEP_CHAR '/'
00081 #define PLATFORM_SEP_ALTCHAR '\\'
00082 #define PLATFORM_EXTERN_C extern "C" __attribute__((visibility("default")))
00083 #endif
00084
00085 #if !defined SOURCEMOD_BUILD
00086 #define SOURCEMOD_BUILD
00087 #endif
00088
00089 #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_
00090