You've already forked ultrasm64-2
mirror of
https://github.com/HackerN64/ultrasm64-2.git
synced 2026-01-21 10:38:08 -08:00
init2
This commit is contained in:
28
include/macros.h
Normal file
28
include/macros.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef _MACROS_H_
|
||||
#define _MACROS_H_
|
||||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define GLUE(a, b) a ## b
|
||||
#define GLUE2(a, b) GLUE(a, b)
|
||||
|
||||
// Avoid compiler warnings for unused variables
|
||||
#ifdef __GNUC__
|
||||
#define UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define UNUSED
|
||||
#endif
|
||||
|
||||
// Ignore GLOBAL_ASM blocks when syntax-checking with GCC
|
||||
#ifdef __GNUC__
|
||||
#define GLOBAL_ASM(...)
|
||||
#endif
|
||||
|
||||
// Static assertions
|
||||
#ifdef __GNUC__
|
||||
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
|
||||
#else
|
||||
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user