Trigger build for hl2sdk-l4d changes.
2 * vim: set ts=4 sw=4 tw=99 noet :
3 * ======================================================
5 * Copyright (C) 2004-2009 AlliedModders LLC and authors.
7 * ======================================================
9 * This software is provided 'as-is', without any express or implied warranty.
10 * In no event will the authors be held liable for any damages arising from
11 * the use of this software.
13 * Permission is granted to anyone to use this software for any purpose,
14 * including commercial applications, and to alter it and redistribute it
15 * freely, subject to the following restrictions:
17 * 1. The origin of this software must not be misrepresented; you must not
18 * claim that you wrote the original software. If you use this software in a
19 * product, an acknowledgment in the product documentation would be
20 * appreciated but is not required.
21 * 2. Altered source versions must be plainly marked as such, and must not be
22 * misrepresented as being the original software.
23 * 3. This notice may not be removed or altered from any source distribution.
26 #ifndef _INCLUDE_OSLINK_H
27 #define _INCLUDE_OSLINK_H
30 * @brief Defines OS-independent information
34 #if defined __WIN32__ || defined _WIN32 || defined WIN32
35 #define WIN32_LEAN_AND_MEAN
37 #if defined _MSC_VER && _MSC_VER >= 1400
40 #define mkdir(a) _mkdir(a)
45 #define dlmount(x) LoadLibrary(x)
46 #define dlsym(x, s) GetProcAddress(x, s)
47 #define dlclose(x) FreeLibrary(x)
48 const char* dlerror();
49 #define abspath(x, s) _fullpath(x, s, sizeof(x))
50 #define PATH_SEP_STR "\\"
51 #define PATH_SEP_CHAR '\\'
52 #define ALT_SEP_CHAR '/'
53 #define PATH_SIZE MAX_PATH
54 #define strcasecmp stricmp
55 inline bool _IsPathSepChar(char c) { return (c == '/' || c == '\\'); }
56 #elif defined __linux__ || defined __APPLE__
59 #elif defined __APPLE__
61 #include <sys/syslimits.h>
65 #include <sys/types.h>
67 typedef void* HINSTANCE;
68 #define dlmount(x) dlopen(x,RTLD_NOW)
69 #define abspath(x, s) realpath(s, x)
70 #define PATH_SEP_STR "/"
71 #define PATH_SEP_CHAR '/'
72 #define ALT_SEP_CHAR '\\'
73 #define PATH_SIZE PATH_MAX
75 #define stricmp strcasecmp
78 #define strnicmp strncasecmp
80 inline bool _IsPathSepChar(char c) { return (c == '/'); }
83 #if defined __linux__ || defined __APPLE__
88 bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength);
90 #if defined __WIN32__ || defined _WIN32 || defined WIN32
91 #define SMM_API extern "C" __declspec(dllexport)
92 #elif defined __GNUC__
94 #define SMM_API extern "C" __attribute__ ((visibility("default")))
96 #define SMM_API extern "C"
100 #if defined __WIN32__ || defined _WIN32 || defined WIN32
101 typedef __int64 int64_t;
102 typedef unsigned __int64 uint64_t;
103 typedef __int32 int32_t;
104 typedef unsigned __int32 uint32_t;
105 #elif defined __GNUC__
107 #if !__GLIBC_HAVE_LONG_LONG
108 typedef long long int64_t;
109 typedef unsigned long long uint64_t;
113 #if !defined __linux__ && !defined __APPLE__
114 #define snprintf _snprintf
115 #if defined _MSC_VER && _MSC_VER < 1500
116 #define vsnprintf _vsnprintf
120 #endif //_INCLUDE_OSLINK_H