You've already forked ultrasm64-2
mirror of
https://github.com/HackerN64/ultrasm64-2.git
synced 2026-01-21 10:38:08 -08:00
Refresh 3
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef _MACROS_H_
|
||||
#define _MACROS_H_
|
||||
|
||||
#include "platform_info.h"
|
||||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define GLUE(a, b) a ## b
|
||||
@@ -13,11 +15,6 @@
|
||||
#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)
|
||||
@@ -25,6 +22,20 @@
|
||||
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
|
||||
#endif
|
||||
|
||||
// Align to 8-byte boundary for DMA requirements
|
||||
#ifdef __GNUC__
|
||||
#define ALIGNED8 __attribute__((aligned(8)))
|
||||
#else
|
||||
#define ALIGNED8
|
||||
#endif
|
||||
|
||||
// Align to 16-byte boundary for audio lib requirements
|
||||
#ifdef __GNUC__
|
||||
#define ALIGNED16 __attribute__((aligned(16)))
|
||||
#else
|
||||
#define ALIGNED16
|
||||
#endif
|
||||
|
||||
// convert a virtual address to physical.
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) & 0x1FFFFFFF)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user