public/sm_platform.h

Go to the documentation of this file.
00001 /**
00002  * vim: set ts=4 :
00003  * =============================================================================
00004  * SourceMod
00005  * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
00006  * =============================================================================
00007  *
00008  * This program is free software; you can redistribute it and/or modify it under
00009  * the terms of the GNU General Public License, version 3.0, as published by the
00010  * Free Software Foundation.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  *
00017  * You should have received a copy of the GNU General Public License along with
00018  * this program.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  * As a special exception, AlliedModders LLC gives you permission to link the
00021  * code of this program (as well as its derivative works) to "Half-Life 2," the
00022  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
00023  * by the Valve Corporation.  You must obey the GNU General Public License in
00024  * all respects for all other code used.  Additionally, AlliedModders LLC grants
00025  * this exception to all derivative works.  AlliedModders LLC defines further
00026  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
00027  * or <http://www.sourcemod.net/license.php>.
00028  *
00029  * Version: $Id$
00030  */
00031 
00032 #ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
00033 #define _INCLUDE_SOURCEMOD_PLATFORM_H_
00034 
00035 /**
00036  * @file sm_platform.h
00037  * @brief Contains platform-specific macros for abstraction.
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 

Generated on Sun Dec 28 23:26:25 2008 for SourceMod SDK by  doxygen 1.5.1