]> git.sur5r.net Git - cc65/blobdiff - src/ca65/symentry.h
Added variable symbols using .set
[cc65] / src / ca65 / symentry.h
index c9772a99edf09e43ef33c312118753384af21310..a5d745dd8a73fc8bc0752521f86d0517e84da2eb 100644 (file)
@@ -64,7 +64,8 @@
 #define SF_GLOBAL      0x0010          /* Global symbol */
 #define SF_LOCAL        0x0020          /* Cheap local symbol */
 #define SF_LABEL        0x0080          /* Used as a label */
-#define SF_FORCED       0x0100          /* Forced import, SF_IMPORT also set */
+#define SF_VAR          0x0100          /* Variable symbol */
+#define SF_FORCED       0x0400          /* Forced import, SF_IMPORT also set */
 #define SF_INDEXED     0x0800          /* Index is valid */
 #define SF_MULTDEF             0x2000          /* Multiply defined symbol */
 #define        SF_DEFINED      0x4000          /* Defined */
@@ -217,6 +218,17 @@ INLINE int SymIsExport (const SymEntry* S)
 #  define SymIsExport(S)  (((S)->Flags & SF_EXPORT) != 0)
 #endif
 
+#if defined(HAVE_INLINE)
+INLINE int SymIsVar (const SymEntry* S)
+/* Return true if the given symbol is marked as variable */
+{
+    /* Check the variable flag */
+    return (S->Flags & SF_VAR) != 0;
+}
+#else
+#  define SymIsVar(S)   (((S)->Flags & SF_VAR) != 0)
+#endif
+
 int SymIsConst (SymEntry* Sym, long* Val);
 /* Return true if the given symbol has a constant value. If Val is not NULL
  * and the symbol has a constant value, store it's value there.