alter DEBUG_LVAR semantics
This commit is contained in:
parent
b5433abf22
commit
8f3aaba794
@ -27,7 +27,7 @@ GLOBAL struct {
|
||||
struct arena arena;
|
||||
struct string write_path;
|
||||
struct sync_flag quit_sf;
|
||||
} L = { 0 } DEBUG_LVAR(L_app);
|
||||
} L = { 0 }, DEBUG_LVAR(L_app);
|
||||
|
||||
/* ========================== *
|
||||
* Write directory
|
||||
|
||||
@ -29,7 +29,7 @@ GLOBAL struct {
|
||||
u64 dbg_table_count;
|
||||
struct sys_mutex dbg_table_mutex;
|
||||
#endif
|
||||
} L = { 0 } DEBUG_LVAR(L_asset_cache);
|
||||
} L = { 0 }, DEBUG_LVAR(L_asset_cache);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
12
src/common.h
12
src/common.h
@ -114,9 +114,9 @@ extern "C" {
|
||||
/* For use after a static 'L' state variable is declared. This will create a
|
||||
* variable that points to the 'L' variable and is kept alive (so that the
|
||||
* debugger can reference the state with a variable other than 'L') */
|
||||
# define DEBUG_LVAR(var) ,__attribute((used)) *var = &L;
|
||||
# define DEBUG_LVAR(var) __attribute((used)) *var = &L;
|
||||
#else
|
||||
# define DEBUG_LVAR(var)
|
||||
# define DEBUG_LVAR(var) __attribute((unused)) *var = &L;
|
||||
#endif
|
||||
|
||||
#if RTC
|
||||
@ -203,14 +203,6 @@ extern "C" {
|
||||
#define IS_ARRAY(a) (IS_INDEXABLE(a) && (((void *)&a) == ((void *)a)))
|
||||
|
||||
/* Pack */
|
||||
#if 0
|
||||
#if COMPILER_MSVC
|
||||
# define PACKED(declaration) __pragma(pack(push, 1)) declaration __pragma(pack(pop))
|
||||
#else
|
||||
# define PACKED(declaration) declaration __attribute((__packed__))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PACKED __attribute((__packed__))
|
||||
|
||||
/* Color */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
GLOBAL struct {
|
||||
struct renderer_handle solid_white;
|
||||
} L = { 0 } DEBUG_LVAR(L_draw);
|
||||
} L = { 0 }, DEBUG_LVAR(L_draw);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
@ -32,7 +32,7 @@ struct font_task_params_store {
|
||||
|
||||
GLOBAL struct {
|
||||
struct font_task_params_store params;
|
||||
} L = { 0 } DEBUG_LVAR(L_font);
|
||||
} L = { 0 }, DEBUG_LVAR(L_font);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
@ -27,7 +27,7 @@ GLOBAL struct {
|
||||
/* Game thread output */
|
||||
struct sys_mutex published_tick_mutex;
|
||||
struct tick published_tick;
|
||||
} L = { 0 } DEBUG_LVAR(L_game);
|
||||
} L = { 0 }, DEBUG_LVAR(L_game);
|
||||
|
||||
/* ========================== *
|
||||
* Entity allocation
|
||||
|
||||
@ -19,7 +19,7 @@ GLOBAL struct {
|
||||
log_event_callback_func *callbacks_head;
|
||||
struct sys_file file;
|
||||
b32 file_valid;
|
||||
} L = { 0 } DEBUG_LVAR(L_log);
|
||||
} L = { 0 }, DEBUG_LVAR(L_log);
|
||||
|
||||
GLOBAL const struct log_level_settings g_log_level_settings[LOG_LEVEL_COUNT] = {
|
||||
[LOG_LEVEL_CRITICAL] = {
|
||||
|
||||
@ -66,7 +66,7 @@ GLOBAL struct {
|
||||
struct track *track_last_playing;
|
||||
u64 track_playing_count;
|
||||
struct track *track_first_free;
|
||||
} L = { 0 } DEBUG_LVAR(L_mixer);
|
||||
} L = { 0 }, DEBUG_LVAR(L_mixer);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
@ -41,7 +41,7 @@ GLOBAL struct {
|
||||
WAVEFORMATEX *buffer_format;
|
||||
u32 buffer_frames;
|
||||
HANDLE mmtc_handle;
|
||||
} L = { 0 } DEBUG_LVAR(L_playback_wasapi);
|
||||
} L = { 0 }, DEBUG_LVAR(L_playback_wasapi);
|
||||
|
||||
/* ========================== *
|
||||
* Initialize
|
||||
|
||||
@ -143,7 +143,7 @@ GLOBAL struct {
|
||||
|
||||
struct dx11_shader_desc shader_info[NUM_SHADERS];
|
||||
|
||||
} L = { 0 } DEBUG_LVAR(L_renderer_d3d11);
|
||||
} L = { 0 }, DEBUG_LVAR(L_renderer_d3d11);
|
||||
|
||||
/* ========================== *
|
||||
* Util
|
||||
|
||||
@ -28,7 +28,7 @@ struct sheet_task_params_store {
|
||||
|
||||
GLOBAL struct {
|
||||
struct sheet_task_params_store params;
|
||||
} L = { 0 } DEBUG_LVAR(L_sheet);
|
||||
} L = { 0 }, DEBUG_LVAR(L_sheet);
|
||||
|
||||
|
||||
/* ========================== *
|
||||
|
||||
@ -28,7 +28,7 @@ struct sound_task_params_store {
|
||||
|
||||
GLOBAL struct {
|
||||
struct sound_task_params_store params;
|
||||
} L = { 0 } DEBUG_LVAR(L_sound);
|
||||
} L = { 0 }, DEBUG_LVAR(L_sound);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
@ -87,7 +87,7 @@ GLOBAL struct {
|
||||
struct sys_mutex windows_mutex;
|
||||
struct arena windows_arena;
|
||||
struct win32_window *first_free_window;
|
||||
} L = { 0 } DEBUG_LVAR(L_sys_win32);
|
||||
} L = { 0 }, DEBUG_LVAR(L_sys_win32);
|
||||
|
||||
/* ========================== *
|
||||
* Events
|
||||
|
||||
@ -33,7 +33,7 @@ struct texture_task_params_store {
|
||||
|
||||
GLOBAL struct {
|
||||
struct texture_task_params_store params;
|
||||
} L = { 0 } DEBUG_LVAR(L_texture);
|
||||
} L = { 0 }, DEBUG_LVAR(L_texture);
|
||||
|
||||
/* ========================== *
|
||||
* Startup
|
||||
|
||||
@ -36,8 +36,8 @@ extern "C"
|
||||
|
||||
GLOBAL struct {
|
||||
/* FIXME: Do we need to wrap this in a mutex? */
|
||||
IDWriteFactory5 *factory = NULL;
|
||||
} L = {} DEBUG_LVAR(L_ttf_dwrite);
|
||||
IDWriteFactory5 *factory;
|
||||
} L = { 0 }, DEBUG_LVAR(L_ttf_dwrite);
|
||||
|
||||
/* ========================== *
|
||||
* Decode font
|
||||
|
||||
@ -55,7 +55,7 @@ GLOBAL struct {
|
||||
struct v2 screen_size;
|
||||
struct v2 screen_center;
|
||||
struct v2 screen_mouse;
|
||||
} L = { 0 } DEBUG_LVAR(L_user);
|
||||
} L = { 0 }, DEBUG_LVAR(L_user);
|
||||
|
||||
|
||||
/* ========================== *
|
||||
|
||||
@ -85,7 +85,7 @@ GLOBAL struct {
|
||||
/* Pointers to the last piece of work of each priority in the scheduled
|
||||
* work list (used for O(1) insertion) */
|
||||
struct work *scheduled_work_priority_tails[NUM_WORK_PRIORITIES];
|
||||
} L = { 0 } DEBUG_LVAR(L_work);
|
||||
} L = { 0 }, DEBUG_LVAR(L_work);
|
||||
|
||||
INTERNAL void worker_thread_entry_point(void *thread_data);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user