sourcemm/sample_mm/oslink.h
changeset 218 d40365b50d43
parent 35 78188da97068
child 219 8e1b76a659b0
     1.1 --- a/sourcemm/sample_mm/oslink.h	Wed Jul 19 06:54:46 2006 +0000
     1.2 +++ b/sourcemm/sample_mm/oslink.h	Wed Jul 19 06:57:03 2006 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /* ======== SourceMM ========
     1.5 -* Copyright (C) 2004-2005 Metamod:Source Development Team
     1.6 +* Copyright (C) 2004-2006 Metamod:Source Development Team
     1.7  * No warranties of any kind
     1.8  *
     1.9  * License: zlib/libpng
    1.10 @@ -19,14 +19,22 @@
    1.11  #if defined __WIN32__ || defined _WIN32 || defined WIN32
    1.12  	#define WIN32_LEAN_AND_MEAN
    1.13  	#define OS_WIN32
    1.14 +	#if defined _MSC_VER && _MSC_VER >= 1400
    1.15 +		#undef ARRAYSIZE
    1.16 +	#else
    1.17 +		#define mkdir _mkdir
    1.18 +	#endif
    1.19  	#include <windows.h>
    1.20  	#include <io.h>
    1.21  	#include <direct.h>
    1.22 -	#define mkdir(a) _mkdir(a)
    1.23  	#define		dlmount(x)		LoadLibrary(x)
    1.24  	#define		dlsym(x, s)		GetProcAddress(x, s)
    1.25  	#define		dlclose(x)		FreeLibrary(x)
    1.26  	const char*	dlerror();
    1.27 +	#define	PATH_SEP_STR	"\\"
    1.28 +	#define PATH_SEP_CHAR	'\\'
    1.29 +	#define ALT_SEP_CHAR	'/'
    1.30 +	#define SERVER_DLL		"server.dll"
    1.31  #elif defined __linux__
    1.32  	#define OS_LINUX
    1.33  	#include <dlfcn.h>
    1.34 @@ -35,6 +43,11 @@
    1.35  	#include <dirent.h>
    1.36  	#define		dlmount(x)		dlopen(x,RTLD_NOW)
    1.37  	typedef		void*			HINSTANCE;
    1.38 +	#define	PATH_SEP_STR	"/"
    1.39 +	#define PATH_SEP_CHAR	'/'
    1.40 +	#define ALT_SEP_CHAR	'\\'
    1.41 +	#define	stricmp				strcasecmp
    1.42 +	#define SERVER_DLL		"server_i486.so"
    1.43  #endif
    1.44  
    1.45  #if defined __linux__
    1.46 @@ -42,6 +55,8 @@
    1.47  	int GetLastError();
    1.48  #endif
    1.49  
    1.50 +bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength);
    1.51 +
    1.52  #if defined __WIN32__ || defined _WIN32 || defined WIN32
    1.53  	#define SMM_API extern "C" __declspec(dllexport)
    1.54  #elif defined __GNUC__
    1.55 @@ -52,11 +67,12 @@
    1.56  	typedef __int64				int64_t;
    1.57  	typedef unsigned __int64	uint64_t;
    1.58  #elif defined __GNUC__
    1.59 -# if !__GLIBC_HAVE_LONG_LONG
    1.60 +#include <stdint.h>
    1.61 +#if !__GLIBC_HAVE_LONG_LONG
    1.62  	typedef long long			int64_t;
    1.63 -# endif
    1.64  	typedef unsigned long long	uint64_t;
    1.65  #endif
    1.66 +#endif
    1.67  
    1.68  #ifndef __linux__
    1.69  	#define snprintf	_snprintf