3 * ===============================================================
4 * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC.
6 * ===============================================================
8 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
9 * or modified under the Terms and Conditions of its License Agreement, which is found
10 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
11 * may change at any time. To view the latest information, see:
12 * http://www.sourcemod.net/license.php
17 #ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
18 #define _INCLUDE_SOURCEMOD_PLATFORM_H_
22 * @brief Contains platform-specific macros for abstraction.
25 #if defined WIN32 || defined WIN64
26 #define PLATFORM_WINDOWS
27 #if !defined WIN32_LEAN_AND_MEAN
28 #define WIN32_LEAN_AND_MEAN
31 #define snprintf _snprintf
36 #define strcasecmp strcmpi
39 #define PLATFORM_LIB_EXT "dll"
40 #define PLATFORM_MAX_PATH MAX_PATH
41 #define PLATFORM_SEP_CHAR '\\'
42 #define PLATFORM_SEP_ALTCHAR '/'
43 #define PLATFORM_EXTERN_C extern "C" __declspec(dllexport)
44 #elif defined __linux__
45 #define PLATFORM_LINUX
46 #define PLATFORM_POSIX
52 #define PLATFORM_MAX_PATH PATH_MAX
53 #define PLATFORM_LIB_EXT "so"
54 #define PLATFORM_SEP_CHAR '/'
55 #define PLATFORM_SEP_ALTCHAR '\\'
56 #define PLATFORM_EXTERN_C extern "C" __attribute__((visibility("default")))
59 #if !defined SOURCEMOD_BUILD
60 #define SOURCEMOD_BUILD
63 #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_