Changeset 960c9f0 in rtems


Ignore:
Timestamp:
Sep 5, 2014, 3:29:45 AM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, 5, master
Children:
b2356837
Parents:
bc35eeca
Message:

tools: Remove invalid cpp characters from the header guards.

The waf converter in examples-v2 uses an absolute path and this
creates defines with invalid characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/build/rtems-bin2c.c

    rbc35eeca r960c9f0  
    9999    exit(1);
    100100  }
    101  
     101
    102102  if ( createC ) {
    103103  ocfile = fopen(ocname, "wb");
     
    107107  }
    108108  }
    109  
     109
    110110  if ( createH ) {
    111111  ohfile = fopen(ohname, "wb");
     
    115115  }
    116116  }
    117  
     117
    118118  /* find basename */
    119119  char *ifbasename = strdup(ifname);
    120120  ifbasename = basename(ifbasename);
    121  
     121
    122122  strcpy(buf, ifbasename);
    123123  for (p = buf; *p != '\0'; ++p)
     
    171171  );
    172172  } /* createC */
    173  
     173
    174174  /*****************************************************************/
    175175  /******                    END OF C FILE                     *****/
     
    178178  if ( createH ) {
    179179  /* print H file header */
     180  char hbasename[PATH_MAX];
     181  char* p;
     182  /* Clean up the file name if it is an abs path */
     183  strcpy(
     184    hbasename,
     185    obasename
     186  );
     187  p = hbasename;
     188  while (*p != '\0') {
     189    if (*p < '0' || *p > 'z')
     190      *p = '_';
     191    ++p;
     192  }
    180193  fprintf(
    181194    ohfile,
     
    192205    "\n",
    193206    ifbasename,  /* header */
    194     obasename,  /* ifndef */
    195     obasename   /* define */
     207    hbasename,  /* ifndef */
     208    hbasename   /* define */
    196209  );
    197210
     
    220233  );
    221234  } /* createH */
    222  
     235
    223236  /*****************************************************************/
    224237  /******                    END OF H FILE                     *****/
Note: See TracChangeset for help on using the changeset viewer.