2007-01-26 02:55:06 +01:00
|
|
|
/**
|
2007-01-26 03:27:34 +01:00
|
|
|
* vim: set ts=4 :
|
2007-08-01 03:54:53 +02:00
|
|
|
* ================================================================
|
|
|
|
* SourceMod
|
|
|
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ================================================================
|
2007-01-26 02:55:06 +01:00
|
|
|
*
|
2007-08-01 03:54:53 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License,
|
|
|
|
* version 3.0, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to
|
|
|
|
* link the code of this program (as well as its derivative works) to
|
|
|
|
* "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
|
|
|
|
* Game MODs that run on software by the Valve Corporation. You must
|
|
|
|
* obey the GNU General Public License in all respects for all other
|
|
|
|
* code used. Additionally, AlliedModders LLC grants this exception
|
|
|
|
* to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version
|
|
|
|
* JULY-31-2007), or <http://www.sourcemod.net/license.php>.
|
2007-01-26 02:55:06 +01:00
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
2007-01-19 06:33:04 +01:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_PLATFORM_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_PLATFORM_H_
|
|
|
|
|
|
|
|
/**
|
2007-01-26 02:55:06 +01:00
|
|
|
* @file sm_platform.h
|
|
|
|
* @brief Contains platform-specific macros for abstraction.
|
2007-01-19 06:33:04 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined WIN32 || defined WIN64
|
|
|
|
#define PLATFORM_WINDOWS
|
|
|
|
#if !defined WIN32_LEAN_AND_MEAN
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#endif
|
|
|
|
#if !defined snprintf
|
|
|
|
#define snprintf _snprintf
|
|
|
|
#endif
|
|
|
|
#if !defined stat
|
|
|
|
#define stat _stat
|
|
|
|
#endif
|
|
|
|
#define strcasecmp strcmpi
|
2007-04-11 18:24:50 +02:00
|
|
|
#define strncasecmp strnicmp
|
2007-01-19 06:33:04 +01:00
|
|
|
#include <windows.h>
|
|
|
|
#include <direct.h>
|
|
|
|
#define PLATFORM_LIB_EXT "dll"
|
|
|
|
#define PLATFORM_MAX_PATH MAX_PATH
|
|
|
|
#define PLATFORM_SEP_CHAR '\\'
|
|
|
|
#define PLATFORM_SEP_ALTCHAR '/'
|
|
|
|
#define PLATFORM_EXTERN_C extern "C" __declspec(dllexport)
|
2007-01-25 10:19:38 +01:00
|
|
|
#elif defined __linux__
|
2007-01-19 06:33:04 +01:00
|
|
|
#define PLATFORM_LINUX
|
|
|
|
#define PLATFORM_POSIX
|
2007-01-25 10:19:38 +01:00
|
|
|
#include <unistd.h>
|
2007-01-19 06:33:04 +01:00
|
|
|
#include <dirent.h>
|
|
|
|
#include <errno.h>
|
2007-01-25 10:19:38 +01:00
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <sys/stat.h>
|
2007-01-19 06:33:04 +01:00
|
|
|
#define PLATFORM_MAX_PATH PATH_MAX
|
|
|
|
#define PLATFORM_LIB_EXT "so"
|
|
|
|
#define PLATFORM_SEP_CHAR '/'
|
|
|
|
#define PLATFORM_SEP_ALTCHAR '\\'
|
|
|
|
#define PLATFORM_EXTERN_C extern "C" __attribute__((visibility("default")))
|
|
|
|
#endif
|
|
|
|
|
2007-01-25 10:19:38 +01:00
|
|
|
#if !defined SOURCEMOD_BUILD
|
|
|
|
#define SOURCEMOD_BUILD
|
|
|
|
#endif
|
|
|
|
|
2007-01-19 06:33:04 +01:00
|
|
|
#endif //_INCLUDE_SOURCEMOD_PLATFORM_H_
|