-
- return 0;
- }
-
- /* #pragma library library_module */
- if(startsWith(ptr, "library")) {
- char *lmodule = strtok((char *)NULL, WHITE);
-
- if(lmodule) {
- /* lmodule can be:
- * c link the C library
- * math link the math library
- * io link the IO library
- * debug link the debug libary
- * anything else, will link as-is */
-
- if(!strcmp(lmodule, "c"))libflags.want_libc = 1;
- else if(!strcmp(lmodule, "math"))libflags.want_libm = 1;
- else if(!strcmp(lmodule, "io"))libflags.want_libio = 1;
- else if(!strcmp(lmodule, "debug"))libflags.want_libdebug = 1;
- else if(!strcmp(lmodule, "ignore"))libflags.ignore = 1;
- else {
- if(!libflags.ignore) {
- fprintf(stderr, "link library %s\n", lmodule);
- addSetHead(&libFilesSet, lmodule);
- }
+ break;
+
+ /* #pragma library library_module */
+ case P_LIBRARY:
+ {
+ const char *lmodule;
+
+ cp = get_pragma_token(cp, &token);
+ if (TOKEN_EOL != token.type)
+ {
+ lmodule = get_pragma_string(&token);
+
+ /* lmodule can be:
+ * c link the C library
+ * math link the math library
+ * io link the IO library
+ * debug link the debug libary
+ * anything else, will link as-is */
+
+ if(!strcmp(lmodule, "c"))
+ libflags.want_libc = 1;
+ else if(!strcmp(lmodule, "math"))
+ libflags.want_libm = 1;
+ else if(!strcmp(lmodule, "io"))
+ libflags.want_libio = 1;
+ else if(!strcmp(lmodule, "debug"))
+ libflags.want_libdebug = 1;
+ else if(!strcmp(lmodule, "ignore"))
+ libflags.ignore = 1;
+ else
+ {
+ if(!libflags.ignore)
+ {
+ fprintf(stderr, "link library %s\n", lmodule);
+ addSetHead(&libFilesSet, (char *)lmodule);
+ }
+ }
+ }
+ else
+ {
+ err = 1;
+ break;
+ }
+
+ cp = get_pragma_token(cp, &token);
+ if (TOKEN_EOL != token.type)
+ {
+ err = 1;
+ break;
+ }