2007-01-26 02:55:06 +01:00
|
|
|
/**
|
2007-01-26 03:27:34 +01:00
|
|
|
* vim: set ts=4 :
|
2007-01-26 02:55:06 +01:00
|
|
|
* ===============================================================
|
2007-01-26 03:50:48 +01:00
|
|
|
* SourceMod, Copyright (C) 2004-2007 AlliedModders LLC.
|
|
|
|
* All rights reserved.
|
2007-01-26 02:55:06 +01:00
|
|
|
* ===============================================================
|
|
|
|
*
|
|
|
|
* This file is part of the SourceMod/SourcePawn SDK. This file may only be used
|
|
|
|
* or modified under the Terms and Conditions of its License Agreement, which is found
|
|
|
|
* in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
|
|
|
|
* may change at any time. To view the latest information, see:
|
|
|
|
* http://www.sourcemod.net/license.php
|
|
|
|
*
|
|
|
|
* 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_
|