]> git.sur5r.net Git - cc65/commitdiff
Parse #pragma align() (does nothing currently).
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 12 Jul 2011 19:35:49 +0000 (19:35 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 12 Jul 2011 19:35:49 +0000 (19:35 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5082 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/global.c
src/cc65/global.h
src/cc65/pragma.c

index 2ab601385f4d9f5d4a8f68a9d102466dd1330d79..f644e51d4f297ca9c9534afdac1653e43c6a7436 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -60,7 +60,8 @@ IntStack SignedChars        = INTSTACK(0);  /* Make characters signed by default
 IntStack CheckStack         = INTSTACK(0);  /* Generate stack overflow checks */
 IntStack Optimize                  = INTSTACK(0);  /* Optimize flag */
 IntStack CodeSizeFactor            = INTSTACK(100);/* Size factor for generated code */
-
+IntStack DataAlignment      = INTSTACK(1);  /* Alignment for data */
+                
 /* File names */
 StrBuf DepName     = STATIC_STRBUF_INITIALIZER; /* Name of dependencies file */
 StrBuf FullDepName = STATIC_STRBUF_INITIALIZER; /* Name of full dependencies file */
index 0406678acf8a8a4154fd955793783bd229ed66b9..0fda8eb056a94c2309cc07cd403d1c121568aa30 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -68,6 +68,7 @@ extern IntStack         SignedChars;          /* Make characters signed by default */
 extern IntStack         CheckStack;            /* Generate stack overflow checks */
 extern IntStack         Optimize;              /* Optimize flag */
 extern IntStack         CodeSizeFactor;                /* Size factor for generated code */
+extern IntStack         DataAlignment;          /* Alignment for data */
 
 /* File names */
 extern StrBuf           DepName;                /* Name of dependencies file */
index 4b690d7a9e3a688d337422f2db2599954c381676..08d62ae20c7a2cb73efe11c6be563f4b567b7bfd 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -63,6 +63,7 @@
 /* Tokens for the #pragmas */
 typedef enum {
     PRAGMA_ILLEGAL = -1,
+    PRAGMA_ALIGN,
     PRAGMA_BSS_NAME,
     PRAGMA_BSSSEG,                                      /* obsolete */
     PRAGMA_CHARMAP,
@@ -95,6 +96,7 @@ static const struct Pragma {
     const char*        Key;            /* Keyword */
     pragma_t           Tok;            /* Token */
 } Pragmas[PRAGMA_COUNT] = {
+    { "align",                  PRAGMA_ALIGN            },
     { "bss-name",               PRAGMA_BSS_NAME         },
     { "bssseg",                 PRAGMA_BSSSEG           },      /* obsolete */
     { "charmap",                PRAGMA_CHARMAP          },
@@ -695,6 +697,10 @@ static void ParsePragma (void)
     /* Switch for the different pragmas */
     switch (Pragma) {
 
+        case PRAGMA_ALIGN:
+            IntPragma (&B, &DataAlignment, 1, 4096);
+            break;
+
        case PRAGMA_BSSSEG:
             Warning ("#pragma bssseg is obsolete, please use #pragma bss-name instead");
             /* FALLTHROUGH */