Skip to content

Commit

Permalink
update thread
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Oct 17, 2024
1 parent 2c8fd0c commit d3cc2cb
Showing 1 changed file with 35 additions and 50 deletions.
85 changes: 35 additions & 50 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,43 @@
#include <stdint.h>



#ifdef __GNUC__
#define UNUSED __attribute__((unused))
# define UNUSED __attribute__((unused))
#elif defined(_MSC_VER)
#define UNUSED __pragma(warning(suppress: 4100 4101 4189))
# define UNUSED __pragma(warning(suppress: 4100 4101 4189))
#else
#define UNUSED
# define UNUSED
#endif

#ifdef __GNUC__
#define DISABLE_WARNING_PUSH _Pragma("GCC diagnostic push")
#define DISABLE_WARNING_POP _Pragma("GCC diagnostic pop")
#define DISABLE_WARNING(w) _Pragma(GCC diagnostic ignored #w)
#elif defined(_MSC_VER)
#define DISABLE_WARNING_PUSH __pragma(warning(push))
#define DISABLE_WARNING_POP __pragma(warning(pop))
#define DISABLE_WARNING(w) __pragma(warning(disable:w))
# define DISABLE_WARNING_PUSH _Pragma("GCC diagnostic push")
# define DISABLE_WARNING_POP _Pragma("GCC diagnostic pop")
# define DISABLE_WARNING(w) _Pragma(GCC diagnostic ignored #w)
#elif defined(_MSC_VER) || defined(_WIN32)
# define DISABLE_WARNING_PUSH __pragma(warning(push))
# define DISABLE_WARNING_POP __pragma(warning(pop))
# define DISABLE_WARNING(w) __pragma(warning(disable:w))
#else
#define DISABLE_WARNING_PUSH
#define DISABLE_WARNING_POP
#define DISABLE_WARNING(w)
# define DISABLE_WARNING_PUSH
# define DISABLE_WARNING_POP
# define DISABLE_WARNING(w)
#endif

#include "config.h"
#include "bendian.h"

// --> debug mode options starts here...
#if DEBUG_MODE == 1
# define DEBUG_PRINT_CODE 1
# define DEBUG_TABLE 0
# define DEBUG_GC 0
# define DEBUG_STACK 0

#define DEBUG_PRINT_CODE 1
#define DEBUG_TABLE 0
#define DEBUG_GC 0
#define DEBUG_STACK 0

#define dbg(x) do { x; } while(0)
#define cond_dbg(c, x) do { if((c)) { x; } } while(0)

# define dbg(x) do { x; } while(0)
# define cond_dbg(c, x) do { if((c)) { x; } } while(0)
#else
#define dbg(x)
#define cond_dbg(c, x)
# define dbg(x)
# define cond_dbg(c, x)
#endif

// --> debug mode options ends here...
Expand All @@ -63,7 +60,7 @@
#define THREADS_MIN 16

#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#define IS_UNIX
# define IS_UNIX
#elif defined _WIN32
// #define NO_OLDNAMES
#endif
Expand All @@ -73,47 +70,35 @@
name " " VERSION(major) "." VERSION(minor) "." VERSION(patch)

#ifdef __clang__

#define COMPILER ("Clang " __clang_version__)

# define COMPILER ("Clang " __clang_version__)
#elif defined(_MSC_VER)

#define COMPILER VERSION_STRING("MSC", _MSC_VER, 0, 0)

# define COMPILER VERSION_STRING("MSC", _MSC_VER, 0, 0)
#elif defined(__MINGW32_MAJOR_VERSION)

#define COMPILER \
VERSION_STRING("MinGW32", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION, 0)

# define COMPILER \
VERSION_STRING("MinGW32", __MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION, 0)
#elif defined(__MINGW64_VERSION_MAJOR)

#define COMPILER \
VERSION_STRING("MinGW-64", __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MAJOR, \
# define COMPILER \
VERSION_STRING("MinGW-64", __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MAJOR, \
0)

#elif defined(__GNUC__)

#define COMPILER \
VERSION_STRING("GCC", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)

# define COMPILER \
VERSION_STRING("GCC", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
#else

#define COMPILER "Unknown Compiler"

# define COMPILER "Unknown Compiler"
#endif

#if defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
#define LIBRARY_FILE_EXTENSION ".dylib"
# define LIBRARY_FILE_EXTENSION ".dylib"
#elif defined(_WIN32)
#define LIBRARY_FILE_EXTENSION ".dll"
# define LIBRARY_FILE_EXTENSION ".dll"
#else
#define LIBRARY_FILE_EXTENSION ".so"
# define LIBRARY_FILE_EXTENSION ".so"
#endif

#define DEFAULT_GC_START (1024 * 1024)

#if defined(_WIN32) && !defined(errno)
#define errno (GetLastError())
# define errno (GetLastError())
#endif


Expand Down

0 comments on commit d3cc2cb

Please sign in to comment.