mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Get rid of obsoleted function
This commit is contained in:
@@ -111,7 +111,6 @@ void sym_ShiftCurrentMacroArgs(void);
|
||||
struct sSymbol *sym_AddString(char const *tzSym, char const *tzValue);
|
||||
uint32_t sym_GetDefinedValue(char const *s);
|
||||
void sym_Purge(char const *tzName);
|
||||
bool sym_IsRelocDiffDefined(char const *tzSym1, char const *tzSym2);
|
||||
|
||||
/* Functions to save and restore the current symbol scope. */
|
||||
struct sSymbol *sym_GetCurrentSymbolScope(void);
|
||||
|
||||
@@ -586,53 +586,6 @@ struct sSymbol *sym_AddReloc(char const *tzSym)
|
||||
return pScope;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the subtraction of two symbols is defined. That is, either both
|
||||
* symbols are defined and the result is a constant, or both symbols are
|
||||
* relocatable and belong to the same section.
|
||||
*
|
||||
* It returns 1 if the difference is defined, 0 if not.
|
||||
*/
|
||||
bool sym_IsRelocDiffDefined(char const *tzSym1, char const *tzSym2)
|
||||
{
|
||||
const struct sSymbol *nsym1 = sym_FindSymbol(tzSym1);
|
||||
const struct sSymbol *nsym2 = sym_FindSymbol(tzSym2);
|
||||
|
||||
/* Do the symbols exist? */
|
||||
if (nsym1 == NULL)
|
||||
fatalerror("Symbol \"%s\" isn't defined.", tzSym1);
|
||||
|
||||
if (nsym2 == NULL)
|
||||
fatalerror("Symbol \"%s\" isn't defined.", tzSym2);
|
||||
|
||||
int32_t s1const = sym_IsConstant(nsym1);
|
||||
int32_t s2const = sym_IsConstant(nsym2);
|
||||
|
||||
/* Both are non-relocatable */
|
||||
if (s1const && s2const)
|
||||
return true;
|
||||
|
||||
/* One of them is relocatable, the other one is not. */
|
||||
if (s1const ^ s2const)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Both of them are relocatable. Make sure they are defined (internal
|
||||
* coherency with sym_AddReloc and sym_AddLocalReloc).
|
||||
*/
|
||||
if (!sym_IsDefined(nsym1))
|
||||
fatalerror("Label \"%s\" isn't defined.", tzSym1);
|
||||
|
||||
if (!sym_IsDefined(nsym2))
|
||||
fatalerror("Label \"%s\" isn't defined.", tzSym2);
|
||||
|
||||
/*
|
||||
* Both of them must be in the same section for the difference to be
|
||||
* defined.
|
||||
*/
|
||||
return nsym1->pSection == nsym2->pSection;
|
||||
}
|
||||
|
||||
/*
|
||||
* Export a symbol
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user