Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions amx/amx.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@
#include "osdefs.h"
#if defined __LINUX__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h>
#include <unistd.h>
#if !defined AMX_NODYNALOAD
#include <dlfcn.h>
#endif
#if defined AMX_JIT
#include <sys/types.h>
#include <sys/mman.h>
#endif
#if defined __APPLE__
#include <zconf.h>
#include <errno.h>
Expand All @@ -52,13 +49,6 @@
#include <wchar.h> /* for wcslen() */
#endif

#if defined __ECOS__
/* eCos puts include files in cyg/package_name */
#include <cyg/pawn/amx.h>
#else
#include "amx.h"
#endif

#if (defined _Windows && !defined AMX_NODYNALOAD) || (defined AMX_JIT && __WIN32__)
#include <windows.h>
#endif
Expand Down Expand Up @@ -127,9 +117,6 @@
#if defined AMX_NO_NATIVEINFO
#undef AMX_NATIVEINFO
#endif
#if AMX_USERNUM <= 0
#undef AMX_XXXUSERDATA
#endif
#if defined AMX_JIT
/* JIT is incompatible with macro instructions, packed opcodes and overlays */
#if !defined AMX_NO_MACRO_INSTR
Expand Down Expand Up @@ -159,6 +146,24 @@
#define NATIVEADDR(addr,high) (AMX_NATIVE)(intptr_t)(addr)
#endif

#if defined __LINUX__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#if defined AMX_JIT
#include <sys/types.h>
#include <sys/mman.h>
#endif
#endif

#if defined __ECOS__
/* eCos puts include files in cyg/package_name */
#include <cyg/pawn/amx.h>
#else
#include "amx.h"
#endif

#if AMX_USERNUM <= 0
#undef AMX_XXXUSERDATA
#endif

#if defined AMX_ALTCORE
#if defined __WIN32__
/* For Watcom C/C++ use register calling convention (faster); for
Expand Down
2 changes: 2 additions & 0 deletions amx/amx.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ int AMXAPI amx_Allot(AMX *amx, int cells, cell **address);
int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, const cell *params);
int AMXAPI amx_Cleanup(AMX *amx);
int AMXAPI amx_Clone(AMX *amxClone, AMX *amxSource, void *data);
int AMXAPI amx_ConsoleInit(AMX *amx);
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index);
int AMXAPI amx_FindNative(AMX *amx, const char *name, int *index);
int AMXAPI amx_FindPublic(AMX *amx, const char *name, int *index);
Expand Down Expand Up @@ -514,6 +515,7 @@ int AMXAPI amx_SetCallback(AMX *amx, AMX_CALLBACK callback);
int AMXAPI amx_SetDebugHook(AMX *amx, AMX_DEBUG debug);
int AMXAPI amx_SetString(cell *dest, const char *source, int pack, int use_wchar, size_t size);
int AMXAPI amx_SetUserData(AMX *amx, long tag, void *ptr);
int AMXAPI amx_StringInit(AMX *amx);
int AMXAPI amx_StrLen(const cell *cstring, int *length);
int AMXAPI amx_UTF8Check(const char *string, int *length);
int AMXAPI amx_UTF8Get(const char *string, const char **endptr, cell *value);
Expand Down
5 changes: 2 additions & 3 deletions compiler/sc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ int main(int argc, char *argv[])
return pc_compile(argc,argv);
}

#endif /* !defined NO_MAIN */

/* pc_printf()
* Called for general purpose "console" output. This function prints general
* purpose messages; errors go through pc_error(). The function is modelled
Expand Down Expand Up @@ -439,9 +441,6 @@ long pc_lengthbin(void *handle)
return ftell((FILE*)handle);
}

#endif /* !defined NO_MAIN */


#if !(defined __MSDOS__ || defined __WIN32__ || defined _Windows)
int posix_spawnl(char *pgm,...)
{
Expand Down