public/sm_platform.h
author Scott Ehlert <ds@alliedmods.net>
Sun Jul 15 08:00:26 2007 +0000 (2007-07-15)
changeset 1116 40cc5e9f0f1b
parent 680 b5f7893fd4f6
child 1226 478550a4d5ec
permissions -rw-r--r--
Removed strange debugging code
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC. 
     5  * All rights reserved.
     6  * ===============================================================
     7  *
     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
    13  *
    14  * Version: $Id$
    15  */
    16 
    17 #ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
    18 #define _INCLUDE_SOURCEMOD_PLATFORM_H_
    19 
    20 /**
    21  * @file sm_platform.h
    22  * @brief Contains platform-specific macros for abstraction.
    23  */
    24 
    25 #if defined WIN32 || defined WIN64
    26 #define PLATFORM_WINDOWS
    27 #if !defined WIN32_LEAN_AND_MEAN
    28 #define WIN32_LEAN_AND_MEAN
    29 #endif
    30 #if !defined snprintf
    31 #define snprintf _snprintf
    32 #endif
    33 #if !defined stat
    34 #define stat _stat
    35 #endif
    36 #define strcasecmp strcmpi
    37 #define strncasecmp strnicmp
    38 #include <windows.h>
    39 #include <direct.h>
    40 #define PLATFORM_LIB_EXT		"dll"
    41 #define PLATFORM_MAX_PATH		MAX_PATH
    42 #define PLATFORM_SEP_CHAR		'\\'
    43 #define PLATFORM_SEP_ALTCHAR	'/'
    44 #define PLATFORM_EXTERN_C		extern "C" __declspec(dllexport)
    45 #elif defined __linux__
    46 #define PLATFORM_LINUX
    47 #define PLATFORM_POSIX
    48 #include <unistd.h>
    49 #include <dirent.h>
    50 #include <errno.h>
    51 #include <dlfcn.h>
    52 #include <sys/stat.h>
    53 #define PLATFORM_MAX_PATH		PATH_MAX
    54 #define PLATFORM_LIB_EXT		"so"
    55 #define PLATFORM_SEP_CHAR		'/'
    56 #define PLATFORM_SEP_ALTCHAR	'\\'
    57 #define PLATFORM_EXTERN_C		extern "C" __attribute__((visibility("default")))
    58 #endif
    59 
    60 #if !defined SOURCEMOD_BUILD
    61 #define SOURCEMOD_BUILD
    62 #endif
    63 
    64 #endif //_INCLUDE_SOURCEMOD_PLATFORM_H_