From c3dc656cedffced94c4d516ff1585fe22a13775b Mon Sep 17 00:00:00 2001 From: s1lentq Date: Tue, 5 Apr 2016 04:40:47 +0600 Subject: [PATCH] Added build status to README.md Fix linux compilation --- README.md | 2 +- reapi/include/cssdk/dlls/osconfig.h | 1 + reapi/include/cssdk/engine/osconfig.h | 194 -------------------------- reapi/src/amxxmodule.h | 4 +- 4 files changed, 4 insertions(+), 197 deletions(-) delete mode 100644 reapi/include/cssdk/engine/osconfig.h diff --git a/README.md b/README.md index 4a1fc1a..a11957e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# reapi +# Reapi [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:Reapi_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=Reapi_Publish&guest=1) AMX Mod X module, using API regamedll & rehlds diff --git a/reapi/include/cssdk/dlls/osconfig.h b/reapi/include/cssdk/dlls/osconfig.h index bb71e7b..b92c99b 100644 --- a/reapi/include/cssdk/dlls/osconfig.h +++ b/reapi/include/cssdk/dlls/osconfig.h @@ -124,6 +124,7 @@ #endif typedef unsigned char byte; + typedef unsigned char BYTE; typedef unsigned short uchar16; typedef wchar_t uchar32; #endif // _WIN32 diff --git a/reapi/include/cssdk/engine/osconfig.h b/reapi/include/cssdk/engine/osconfig.h deleted file mode 100644 index bb45a62..0000000 --- a/reapi/include/cssdk/engine/osconfig.h +++ /dev/null @@ -1,194 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* 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, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#ifndef _OSCONFIG_H -#define _OSCONFIG_H - -#ifdef _WIN32 // WINDOWS - #pragma warning(disable : 4005) -#endif // _WIN32 - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#ifdef _WIN32 // WINDOWS - #include - #include - #include // for support IPX - #define PSAPI_VERSION 1 - #include - #include - #include - #include - #include - #include -#else // _WIN32 - #include - #include - //#include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - // Deail with stupid macro in kernel.h - #undef __FUNCTION__ -#endif // _WIN32 - -#include -#include -#include -#include - -#include -#include - -#ifdef _WIN32 // WINDOWS - #define _CRT_SECURE_NO_WARNINGS - #define WIN32_LEAN_AND_MEAN - - #ifndef CDECL - #define CDECL __cdecl - #endif - #define STDCALL __stdcall - #define HIDDEN - #define NOINLINE __declspec(noinline) - #define ALIGN16 __declspec(align(16)) - #define FORCE_STACK_ALIGN - - //inline bool SOCKET_FIONBIO(SOCKET s, int m) { return (ioctlsocket(s, FIONBIO, (u_long*)&m) == 0); } - //inline int SOCKET_MSGLEN(SOCKET s, u_long& r) { return ioctlsocket(s, FIONREAD, (u_long*)&r); } - typedef int socklen_t; - #define SOCKET_FIONBIO(s, m) ioctlsocket(s, FIONBIO, (u_long*)&m) - #define SOCKET_MSGLEN(s, r) ioctlsocket(s, FIONREAD, (u_long*)&r) - #define SIN_GET_ADDR(saddr, r) r = (saddr)->S_un.S_addr - #define SIN_SET_ADDR(saddr, r) (saddr)->S_un.S_addr = (r) - #define SOCKET_CLOSE(s) closesocket(s) - #define SOCKET_AGAIN() (WSAGetLastError() == WSAEWOULDBLOCK) - - inline void* sys_allocmem(unsigned int size) { - return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); - } - - inline void sys_freemem(void* ptr, unsigned int size) { - VirtualFree(ptr, 0, MEM_RELEASE); - } -#else // _WIN32 - #ifdef __FUNCTION__ - #undef __FUNCTION__ - #endif - #define __FUNCTION__ __func__ - - #ifndef PAGESIZE - #define PAGESIZE 4096 - #endif - #define ALIGN(addr) (size_t)((size_t)addr & ~(PAGESIZE-1)) - #define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) - - #define _MAX_FNAME NAME_MAX - #define MAX_PATH 260 - - typedef void *HWND; - - typedef unsigned long DWORD; - typedef unsigned short WORD; - typedef unsigned int UNINT32; - - #define CDECL __attribute__ ((cdecl)) - #define STDCALL __attribute__ ((stdcall)) - #define HIDDEN __attribute__((visibility("hidden"))) - #define NOINLINE __attribute__((noinline)) - #define ALIGN16 __attribute__((aligned(16))) - #define FORCE_STACK_ALIGN __attribute__((force_align_arg_pointer)) - - //inline bool SOCKET_FIONBIO(SOCKET s, int m) { return (ioctl(s, FIONBIO, (int*)&m) == 0); } - //inline int SOCKET_MSGLEN(SOCKET s, u_long& r) { return ioctl(s, FIONREAD, (int*)&r); } - typedef int SOCKET; - #define INVALID_SOCKET (SOCKET)(~0) - #define SOCKET_FIONBIO(s, m) ioctl(s, FIONBIO, (char*)&m) - #define SOCKET_MSGLEN(s, r) ioctl(s, FIONREAD, (char*)&r) - #define SIN_GET_ADDR(saddr, r) r = (saddr)->s_addr - #define SIN_SET_ADDR(saddr, r) (saddr)->s_addr = (r) - #define SOCKET_CLOSE(s) close(s) - #define SOCKET_AGAIN() (errno == EAGAIN) - #define SOCKET_ERROR -1 - - inline void* sys_allocmem(unsigned int size) { - return mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - } - inline void sys_freemem(void* ptr, unsigned int size) { - munmap(ptr, size); - } - - #define WSAENOPROTOOPT ENOPROTOOPT - - #ifndef FALSE - #define FALSE 0 - #endif - #ifndef TRUE - #define TRUE 1 - #endif -#endif // _WIN32 - -#ifdef _WIN32 - static const bool __isWindows = true; - static const bool __isLinux = false; -#else - static const bool __isWindows = false; - static const bool __isLinux = true; -#endif - -#define EXT_FUNC FORCE_STACK_ALIGN - -extern void __declspec(noreturn) rehlds_syserror(const char* fmt, ...); - -#endif // _OSCONFIG_H diff --git a/reapi/src/amxxmodule.h b/reapi/src/amxxmodule.h index 7abd5c3..4104759 100644 --- a/reapi/src/amxxmodule.h +++ b/reapi/src/amxxmodule.h @@ -60,9 +60,9 @@ struct amxx_module_info_s /* calling convention for all interface functions and callback functions */ #if !defined AMXAPI #if defined STDECL -#define AMXAPI __stdcall +#define AMXAPI STDECL #elif defined CDECL -#define AMXAPI __cdecl +#define AMXAPI CDECL #else #define AMXAPI #endif