]> oss.titaniummirror.com Git - nesc.git/blobdiff - src/machine/sdcc.c
Merge branch 'upstream' (nesc-1.3.2)
[nesc.git] / src / machine / sdcc.c
index dbc732d22be992f5ddb5aa5b243015e8bf0bb253..daa5cc72e4f8eae203007e80a4b4879446a4c350 100644 (file)
@@ -42,13 +42,18 @@ static int sdcc_token(const char *token, int len, struct yystype *lvalp)
   struct sdccword *keyword = is_sdcc_word(token, len);
 
   if (keyword)
-    return keyword->token;
+    {
+      lvalp->idtoken.location = last_location();
+      lvalp->idtoken.id = make_cstring(parse_region, token, len);
+      lvalp->idtoken.decl = NULL;
+      return keyword->token;
+    }
 
   return IDENTIFIER;
 }
 
 static machine_spec sdcc_machine = {
-  "sdcc", NULL,
+  "sdcc51", NULL,
   FALSE,                       /* big_endian */
   FALSE,                       /* pcc_bitfield_type_matters */
   8,                           /* empty field boundary - in bits */
@@ -65,12 +70,14 @@ static machine_spec sdcc_machine = {
   1, 1, 1, 1,                  /* int1/2/4/8 align */
   2, 2,                                /* wchar_t, size_t size */
   TRUE, TRUE,                  /* char, wchar_t signed */
+  NULL,                                /* no attribute for async functions */
 
   NULL,                                /* adjust_field_align function */
   NULL, NULL, NULL, NULL,      /* attribute handling functions */
   NULL, sdcc_init,
   sdcc_token,
   NULL,                                /* Keil C special */
-  NULL,                                /* global cpp support */
+  gcc_global_cpp_init,         /* global cpp support: this should be tailored to sdcc
+                                  to get correct behaviour */
   NULL                         /* per-file cpp support */
 };