mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Add test for built-in file symbol
It's currently defined in fstack.c, making it more prone to accidental dropping. Let's not repeat the 0.3.9 scenario...
This commit is contained in:
@@ -29,7 +29,8 @@ struct MacroArgs {
|
||||
sizeof(((struct MacroArgs){0}).args[0]) * (nbArgs))
|
||||
|
||||
static struct MacroArgs *macroArgs = NULL;
|
||||
static uint32_t uniqueID = -1;
|
||||
static uint32_t uniqueID = 0;
|
||||
static uint32_t maxUniqueID = 0;
|
||||
/*
|
||||
* The initialization is somewhat harmful, since it is never used, but it
|
||||
* guarantees the size of the buffer will be correct. I was unable to find a
|
||||
@@ -107,15 +108,23 @@ char const *macro_GetUniqueIDStr(void)
|
||||
void macro_SetUniqueID(uint32_t id)
|
||||
{
|
||||
uniqueID = id;
|
||||
if (id == -1) {
|
||||
if (id == 0) {
|
||||
uniqueIDPtr = NULL;
|
||||
} else {
|
||||
if (uniqueID > maxUniqueID)
|
||||
maxUniqueID = uniqueID;
|
||||
/* The buffer is guaranteed to be the correct size */
|
||||
sprintf(uniqueIDBuf, "_%" PRIu32, id);
|
||||
uniqueIDPtr = uniqueIDBuf;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t macro_UseNewUniqueID(void)
|
||||
{
|
||||
macro_SetUniqueID(++maxUniqueID);
|
||||
return maxUniqueID;
|
||||
}
|
||||
|
||||
void macro_ShiftCurrentArgs(void)
|
||||
{
|
||||
if (macroArgs->shift != macroArgs->nbArgs)
|
||||
|
||||
Reference in New Issue
Block a user