core/sm_platform.h
author David Anderson <dvander@alliedmods.net>
Wed Jan 17 06:49:59 2007 +0000 (2007-01-17)
changeset 308 f0e65f92cb34
parent 294 af1cdf8c81a1
permissions -rw-r--r--
Redesigned how server commands work. The "plugins" command will be back soon.
     1 #ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
     2 #define _INCLUDE_SOURCEMOD_PLATFORM_H_
     3 
     4 /**
     5  * @file Contains platform-specific macros for abstraction.
     6  */
     7 
     8 #if defined WIN32 || defined WIN64
     9 #define PLATFORM_WINDOWS
    10 #if !defined WIN32_LEAN_AND_MEAN
    11 #define WIN32_LEAN_AND_MEAN
    12 #endif
    13 #if !defined snprintf
    14 #define snprintf _snprintf
    15 #endif
    16 #if !defined stat
    17 #define stat _stat
    18 #endif
    19 #define strcasecmp strcmpi
    20 #include <windows.h>
    21 #include <direct.h>
    22 #define PLATFORM_LIB_EXT		"dll"
    23 #define PLATFORM_MAX_PATH		MAX_PATH
    24 #define PLATFORM_SEP_CHAR		'\\'
    25 #define PLATFORM_SEP_ALTCHAR	'/'
    26 #define PLATFORM_EXTERN_C		extern "C" __declspec(dllexport)
    27 #else if defined __linux__
    28 #define PLATFORM_LINUX
    29 #define PLATFORM_POSIX
    30 #include <dirent.h>
    31 #include <errno.h>
    32 #define PLATFORM_MAX_PATH		PATH_MAX
    33 #define PLATFORM_LIB_EXT		"so"
    34 #define PLATFORM_SEP_CHAR		'/'
    35 #define PLATFORM_SEP_ALTCHAR	'\\'
    36 #define PLATFORM_EXTERN_C		extern "C" __attribute__((visibility("default")))
    37 #endif
    38 
    39 #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_