feat(build): implement Clangd support && add lua symbols

This commit is contained in:
phaneron 2026-04-01 17:36:35 -04:00
parent 6163593844
commit e79ee08905
78 changed files with 399 additions and 5445 deletions

View file

@ -5,9 +5,17 @@
#error "Preprocessor mode not detected! You must define either IDA or GHIDRA or BINANA_GENERATOR"
#endif
#if defined(BINANA_GENERATOR)
// add custom generator defines here
#else
#define BITFIELDS_SUPPORTED
#endif
#if defined(IDA)
// why does this work?
// why does this work?
#define DECLARE_ENUM(E) typedef enum E##__ E
#else
@ -18,4 +26,6 @@
#define DECLARE_STRUCT(T) typedef struct T T
#endif
#define DECLARE_UNION(T) typedef union T T
#endif

View file

@ -1,6 +1,14 @@
#ifndef SYSTEM_TYPES_H
#define SYSTEM_TYPES_H
#if defined(CLANGD)
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#endif
// stdint
#if defined(IDA) || defined(BINANA_GENERATOR)
@ -13,9 +21,9 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef int32_t ptrdiff_t;
typedef int32_t ptrdiff_t;
typedef uint32_t uintptr_t;
typedef int32_t intptr_t;
typedef int32_t intptr_t;
#else
@ -38,7 +46,7 @@ typedef char bool;
#endif
// stddef
#if defined(GHIDRA)
#if defined(GHIDRA) || defined(CLANGD)
#include <stddef.h>
@ -64,14 +72,14 @@ typedef char* va_list;
typedef struct fixed16 fixed16;
struct fixed16 {
int16_t n;
int16_t n;
};
struct ubyte4 {
union {
uint8_t b[4];
uint32_t u;
};
union {
uint8_t b[4];
uint32_t u;
};
};
#endif
#endif