Apparently static const struct members don't exist in C.

Let's use #defines, that's much better ... C is nice language Kappa
This commit is contained in:
James Benton 2016-01-07 04:44:44 -08:00
parent 9f42cfa12e
commit acfffa6d85
7 changed files with 20 additions and 16 deletions

View File

@ -16,9 +16,11 @@ typedef struct OSAlarmQueue OSAlarmQueue;
typedef void (*OSAlarmCallback)(OSAlarm *, OSContext *);
#define OS_ALARM_QUEUE_TAG 0x614C6D51u
struct OSAlarmQueue
{
static const uint32_t Tag = 0x614C6D51;
// OS_ALARM_QUEUE_TAG
uint32_t tag;
const char *name;
UNKNOWN(4);
@ -42,9 +44,10 @@ CHECK_OFFSET(OSAlarmLink, 0x00, prev);
CHECK_OFFSET(OSAlarmLink, 0x04, next);
CHECK_SIZE(OSAlarmLink, 0x08);
#define OS_ALARM_TAG 0x614C724Du
struct OSAlarm
{
static const uint32_t Tag = 0x614C724D;
// OS_ALARM_TAG
uint32_t tag;
const char *name;
UNKNOWN(4);

View File

@ -10,11 +10,11 @@ struct OSMutex;
typedef struct OSCondition OSCondition;
#define OS_CONDITION_TAG 0x634E6456u
struct OSCondition
{
static const uint32_t Tag = 0x634E6456;
// OSCondition::Tag
// OS_CONDITION_TAG
uint32_t tag;
// Name set by OSInitCondEx(condition, name)

View File

@ -17,10 +17,10 @@ enum OSEventMode
OS_EVENT_MODE_AUTO = 1,
};
#define OS_EVENT_TAG 0x65566E54u
struct OSEvent
{
static const uint32_t Tag = 0x65566E54;
uint32_t tag;
const char *name;
UNKNOWN(4);

View File

@ -19,10 +19,10 @@ CHECK_OFFSET(OSFastMutexLink, 0x00, next);
CHECK_OFFSET(OSFastMutexLink, 0x04, prev);
CHECK_SIZE(OSFastMutexLink, 0x08);
#define OS_FAST_MUTEX_TAG 0x664D7458u
struct OSFastMutex
{
static const uint32_t Tag = 0x664D7458;
uint32_t tag;
const char *name;
UNKNOWN(4);

View File

@ -21,10 +21,10 @@ CHECK_OFFSET(OSMutexLink, 0x00, next);
CHECK_OFFSET(OSMutexLink, 0x04, prev);
CHECK_SIZE(OSMutexLink, 0x8);
#define OS_MUTEX_TAG 0x6D557458u
struct OSMutex
{
static const uint32_t Tag = 0x6D557458;
// OSMutex::Tag
uint32_t tag;

View File

@ -8,10 +8,10 @@ extern "C" {
typedef struct OSSemaphore OSSemaphore;
#define OS_SEMAPHORE_TAG 0x73506852u
struct OSSemaphore
{
static const uint32_t Tag = 0x73506852;
uint32_t tag;
const char *name;
UNKNOWN(4);

View File

@ -46,9 +46,10 @@ enum OSThreadAttributes
OS_THREAD_ATTRIB_DETACHED = 1 << 4
};
#define OS_CONTEXT_TAG 0x4F53436F6E747874ull
struct OSContext
{
static const uint64_t Tag1 = 0x4F53436F6E747874ull;
uint64_t tag;
uint32_t gpr[32];
uint32_t cr;
@ -122,10 +123,10 @@ CHECK_OFFSET(OSFastMutexQueue, 0x00, head);
CHECK_OFFSET(OSFastMutexQueue, 0x04, tail);
CHECK_SIZE(OSFastMutexQueue, 0x08);
#define OS_THREAD_TAG 0x74487244u
struct OSThread
{
static const uint32_t Tag = 0x74487244;
OSContext context;
uint32_t tag;
OSThreadState state;