Added support for Mac OS X and building with clang (bug 5601, r=dvander).
This commit is contained in:
@@ -114,9 +114,9 @@ cell Call_Void_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(0);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -126,9 +126,9 @@ cell Call_Int_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(0);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void*, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
}
|
||||
@@ -143,9 +143,9 @@ cell Call_Void_Entvar(AMX *amx, cell *params)
|
||||
|
||||
entvars_t *ev1=&(INDEXENT_NEW(id3)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, entvars_t *)>(__func)(pv, 0, ev1);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, entvars_t *)>(__func)(pv, ev1);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -162,9 +162,9 @@ cell Call_Void_Cbase(AMX *amx, cell *params)
|
||||
|
||||
void *pv1=(INDEXENT_NEW(id3)->pvPrivateData);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, void *)>(__func)(pv, 0, pv1);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, void *)>(__func)(pv, pv1);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -177,9 +177,9 @@ cell Call_Int_Float_Int(AMX *amx, cell *params)
|
||||
float f3=amx_ftoc2(*MF_GetAmxAddr(amx, params[3]));
|
||||
int i4=*MF_GetAmxAddr(amx, params[4]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void*, int, float, int)>(__func)(pv, 0, f3, i4);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, float, int)>(__func)(pv, f3, i4);
|
||||
#endif
|
||||
}
|
||||
@@ -196,9 +196,9 @@ cell Call_Void_Entvar_Int(AMX *amx, cell *params)
|
||||
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, entvars_t *, int)>(__func)(pv, 0, ev3, i4);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, entvars_t *, int)>(__func)(pv, ev3, i4);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -215,9 +215,9 @@ cell Call_Int_Cbase(AMX *amx, cell *params)
|
||||
|
||||
void *pv1=(INDEXENT_NEW(id3)->pvPrivateData);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void*, int, void *)>(__func)(pv, 0, pv1);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, void *)>(__func)(pv, pv1);
|
||||
#endif
|
||||
}
|
||||
@@ -229,9 +229,9 @@ cell Call_Void_Int_Int(AMX *amx, cell *params)
|
||||
int i3=*MF_GetAmxAddr(amx, params[3]);
|
||||
int i4=*MF_GetAmxAddr(amx, params[4]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, int, int)>(__func)(pv, 0, i3, i4);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, int, int)>(__func)(pv, i3, i4);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -246,9 +246,9 @@ cell Call_Int_Int_Str_Int(AMX *amx, cell *params)
|
||||
char *sz4=MF_GetAmxString(amx, params[4], 0, NULL);
|
||||
int i5=*MF_GetAmxAddr(amx, params[5]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void*, int, int, const char *, int)>(__func)(pv, 0, i3, sz4, i5);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, int, const char *, int)>(__func)(pv, i3, sz4, i5);
|
||||
#endif
|
||||
}
|
||||
@@ -259,9 +259,9 @@ cell Call_Int_Int(AMX *amx, cell *params)
|
||||
|
||||
int i3=*MF_GetAmxAddr(amx, params[3]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void*, int, int)>(__func)(pv, 0, i3);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, int)>(__func)(pv, i3);
|
||||
#endif
|
||||
}
|
||||
@@ -276,9 +276,9 @@ cell Call_Int_Entvar(AMX *amx, cell *params)
|
||||
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void *, int, entvars_t *)>(__func)(pv, 0, ev3);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, entvars_t *)>(__func)(pv, ev3);
|
||||
#endif
|
||||
}
|
||||
@@ -298,9 +298,9 @@ cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params)
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
entvars_t *ev4=&(INDEXENT_NEW(id4)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void *, int, entvars_t *, entvars_t *, float, int)>(__func)(pv, 0, ev3, ev4, f5, i6);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, entvars_t *, entvars_t *, float, int)>(__func)(pv, ev3, ev4, f5, i6);
|
||||
#endif
|
||||
}
|
||||
@@ -321,9 +321,9 @@ cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params)
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
entvars_t *ev4=&(INDEXENT_NEW(id4)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void *, int, entvars_t *, entvars_t *, float, float, int)>(__func)(pv, 0, ev3, ev4, f5, f6, i7);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, entvars_t *, entvars_t *, float, float, int)>(__func)(pv, ev3, ev4, f5, f6, i7);
|
||||
#endif
|
||||
}
|
||||
@@ -334,9 +334,9 @@ cell Call_Void_Int(AMX *amx, cell *params)
|
||||
|
||||
int i3=*MF_GetAmxAddr(amx, params[3]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void *, int, int)>(__func)(pv, 0, i3);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, int)>(__func)(pv, i3);
|
||||
#endif
|
||||
|
||||
@@ -358,9 +358,9 @@ cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params)
|
||||
void *p3=IndexToPrivate(id3);
|
||||
void *p4=IndexToPrivate(id4);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void *, int, void *, void *, int, float)>(__func)(pv, 0, p3, p4, i5, f6);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, void *, void *, int, float)>(__func)(pv, p3, p4, i5, f6);
|
||||
#endif
|
||||
|
||||
@@ -392,9 +392,9 @@ cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params)
|
||||
CHECK_ENTITY(id3);
|
||||
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void *, int, entvars_t *, float, Vector, TraceResult *, int)>(__func)(pv, 0, ev3, f4, v5, tr6, i7);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, entvars_t *, float, Vector, TraceResult *, int)>(__func)(pv, ev3, f4, v5, tr6, i7);
|
||||
#endif
|
||||
|
||||
@@ -422,9 +422,9 @@ cell Call_Void_Float_Vector_Trace_Int(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void *, int, float, Vector, TraceResult *, int)>(__func)(pv, 0, f3, v4, tr5, i6);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, float, Vector, TraceResult *, int)>(__func)(pv, f3, v4, tr5, i6);
|
||||
#endif
|
||||
|
||||
@@ -435,9 +435,9 @@ cell Call_Str_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(2);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
char *v=reinterpret_cast<char *(__fastcall *)(void *, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
char *v=reinterpret_cast<char *(*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
return MF_SetAmxString(amx, params[3], v == NULL ? "" : v, *MF_GetAmxAddr(amx, params[4]));
|
||||
@@ -447,9 +447,9 @@ cell Call_Str_Void(AMX *amx, cell *params)
|
||||
cell Call_Cbase_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(0);
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
void *ret=reinterpret_cast<void *(__fastcall *)(void *, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
void *ret=reinterpret_cast<void *(*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
return PrivateToIndex(ret);
|
||||
@@ -458,9 +458,9 @@ cell Call_Cbase_Void(AMX *amx, cell *params)
|
||||
cell Call_Vector_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(1);
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
Vector ret=reinterpret_cast<Vector (__fastcall *)(void *, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
Vector ret=reinterpret_cast<Vector (*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
float *out=(float *)MF_GetAmxAddr(amx, params[3]);
|
||||
@@ -481,9 +481,9 @@ cell Call_Vector_pVector(AMX *amx, cell *params)
|
||||
v3.y=fl3[1];
|
||||
v3.z=fl3[2];
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
Vector ret=reinterpret_cast<Vector (__fastcall *)(void *, int, Vector*)>(__func)(pv, 0, &v3);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
Vector ret=reinterpret_cast<Vector (*)(void *, Vector*)>(__func)(pv, &v3);
|
||||
#endif
|
||||
float *out=(float *)MF_GetAmxAddr(amx, params[4]);
|
||||
@@ -508,9 +508,9 @@ cell Call_Int_pVector(AMX *amx, cell *params)
|
||||
v3.y=fl3[1];
|
||||
v3.z=fl3[2];
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
int ret=reinterpret_cast<int (__fastcall *)(void *, int, Vector*)>(__func)(pv, 0, &v3);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
int ret=reinterpret_cast<int (*)(void *, Vector*)>(__func)(pv, &v3);
|
||||
#endif
|
||||
|
||||
@@ -533,9 +533,9 @@ cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params)
|
||||
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void *, int, entvars_t *, float, float)>(__func)(pv, 0, ev3, f4, f5);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, entvars_t *, float, float)>(__func)(pv, ev3, f4, f5);
|
||||
#endif
|
||||
|
||||
@@ -549,9 +549,9 @@ cell Call_Int_pFloat_pFloat(AMX *amx, cell *params)
|
||||
float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3]));
|
||||
float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4]));
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void *, int, float*, float*)>(__func)(pv, 0, &f3, &f4);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, float*, float*)>(__func)(pv, &f3, &f4);
|
||||
#endif
|
||||
|
||||
@@ -568,9 +568,9 @@ cell Call_Void_Entvar_Float(AMX *amx, cell *params)
|
||||
|
||||
entvars_t *ev3=&(INDEXENT_NEW(id3)->v);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
return reinterpret_cast<int (__fastcall *)(void *, int, entvars_t*, float)>(__func)(pv, 0, ev3, f4);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
return reinterpret_cast<int (*)(void *, entvars_t*, float)>(__func)(pv, ev3, f4);
|
||||
#endif
|
||||
}
|
||||
@@ -583,9 +583,9 @@ cell Call_Void_Int_Int_Int(AMX *amx, cell *params)
|
||||
int i4=*MF_GetAmxAddr(amx, params[4]);
|
||||
int i5=*MF_GetAmxAddr(amx, params[5]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, int, int, int)>(__func)(pv, 0, i3, i4, i5);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, int, int, int)>(__func)(pv, i3, i4, i5);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -602,9 +602,9 @@ cell Call_Void_ItemInfo(AMX *amx, cell *params)
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle!");
|
||||
return 0;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, void *)>(__func)(pv, 0, ptr);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void *, void *)>(__func)(pv, ptr);
|
||||
#endif
|
||||
return 1;
|
||||
@@ -614,9 +614,9 @@ cell Call_Float_Void(AMX *amx, cell *params)
|
||||
{
|
||||
SETUP(1);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
float ret=reinterpret_cast<float (__fastcall *)(void*, int)>(__func)(pv, 0);
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
float ret=reinterpret_cast<float (*)(void *)>(__func)(pv);
|
||||
#endif
|
||||
*MF_GetAmxAddr(amx, params[3])=amx_ftoc2(ret);
|
||||
@@ -628,9 +628,9 @@ cell Call_Void_Float_Int(AMX* amx, cell* params)
|
||||
{
|
||||
SETUP(2);
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32)
|
||||
reinterpret_cast<void (__fastcall *)(void*, int, float, char)>(__func)(pv, 0, amx_ctof2(params[3]), static_cast<char>(params[4]));
|
||||
#elif defined __linux__
|
||||
#elif defined(__linux__) || defined(__APPLE__)
|
||||
reinterpret_cast<void (*)(void*, float, char)>(__func)(pv, amx_ctof2(params[3]), static_cast<char>(params[4]));
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user