| @@ -326,7 +326,7 @@ int ieee_finite(double d) · 325 unmodified lines |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /* copy a string and truncate it. */ |
| 329 | | −static char *pstrcpy(char *buf, int buf_size, const char *s) |
| 329 | +char *pstrcpy(char *buf, int buf_size, const char *s) |
| 330 | 330 | { |
| 331 | 331 | char *q, *q_end; |
| 332 | 332 | int c; |
| @@ -346,7 +346,7 @@ static char *pstrcpy(char *buf, int buf_size, const char *s) · 13 unmodified lines |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /* strcat and truncate. */ |
| 349 | | −static char *pstrcat(char *buf, int buf_size, const char *s) |
| 349 | +char *pstrcat(char *buf, int buf_size, const char *s) |
| 350 | 350 | { |
| 351 | 351 | int len; |
| 352 | 352 | len = strlen(buf); |
| @@ -356,7 +356,7 @@ static char *pstrcat(char *buf, int buf_size, const char *s) · 3 unmodified lines |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /* extract the basename of a file */ |
| 359 | | −static char *tcc_basename(const char *name) |
| 359 | +char *tcc_basename(const char *name) |
| 360 | 360 | { |
| 361 | 361 | char *p = strchr(name, 0); |
| 362 | 362 | while (p > name && !IS_PATHSEP(p[-1])) |
| @@ -364,7 +364,7 @@ static char *tcc_basename(const char *name) · 1 unmodified line |
| 364 | 364 | return p; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | | −static char *tcc_fileextension (const char *name) |
| 367 | +char *tcc_fileextension (const char *name) |
| 368 | 368 | { |
| 369 | 369 | char *b = tcc_basename(name); |
| 370 | 370 | char *e = strrchr(b, '.'); |
| @@ -418,7 +418,7 @@ int mem_max_size; · 47 unmodified lines |
| 418 | 418 | unsigned malloc_usable_size(void*); |
| 419 | 419 | #endif |
| 420 | 420 | |
| 421 | | −static inline void tcc_free(void *ptr) |
| 421 | +void tcc_free(void *ptr) |
| 422 | 422 | { |
| 423 | 423 | #ifdef MEM_DEBUG |
| 424 | 424 | mem_cur_size -= malloc_usable_size(ptr); |
| @@ -426,7 +426,7 @@ static inline void tcc_free(void *ptr) · 1 unmodified line |
| 426 | 426 | free(ptr); |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | | −static void *tcc_malloc(unsigned long size) |
| 429 | +void *tcc_malloc(unsigned long size) |
| 430 | 430 | { |
| 431 | 431 | void *ptr; |
| 432 | 432 | ptr = malloc(size); |
| @@ -440,7 +440,7 @@ static void *tcc_malloc(unsigned long size) · 7 unmodified lines |
| 440 | 440 | return ptr; |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | | −static void *tcc_mallocz(unsigned long size) |
| 443 | +void *tcc_mallocz(unsigned long size) |
| 444 | 444 | { |
| 445 | 445 | void *ptr; |
| 446 | 446 | ptr = tcc_malloc(size); |
| @@ -448,7 +448,7 @@ static void *tcc_mallocz(unsigned long size) · 1 unmodified line |
| 448 | 448 | return ptr; |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | | −static inline void *tcc_realloc(void *ptr, unsigned long size) |
| 451 | +void *tcc_realloc(void *ptr, unsigned long size) |
| 452 | 452 | { |
| 453 | 453 | void *ptr1; |
| 454 | 454 | #ifdef MEM_DEBUG |
| @@ -464,7 +464,7 @@ static inline void *tcc_realloc(void *ptr, unsigned long size) · 9 unmodified lines |
| 464 | 464 | return ptr1; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | | −static char *tcc_strdup(const char *str) |
| 467 | +char *tcc_strdup(const char *str) |
| 468 | 468 | { |
| 469 | 469 | char *ptr; |
| 470 | 470 | ptr = tcc_malloc(strlen(str) + 1); |
| @@ -476,7 +476,7 @@ static char *tcc_strdup(const char *str) · 5 unmodified lines |
| 476 | 476 | #define malloc(s) use_tcc_malloc(s) |
| 477 | 477 | #define realloc(p, s) use_tcc_realloc(p, s) |
| 478 | 478 | |
| 479 | | −static void dynarray_add(void ***ptab, int *nb_ptr, void *data) |
| 479 | +void dynarray_add(void ***ptab, int *nb_ptr, void *data) |
| 480 | 480 | { |
| 481 | 481 | int nb, nb_alloc; |
| 482 | 482 | void **pp; |
| @@ -498,7 +498,7 @@ static void dynarray_add(void ***ptab, int *nb_ptr, void *data) · 15 unmodified lines |
| 498 | 498 | *nb_ptr = nb; |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | | −static void dynarray_reset(void *pp, int *n) |
| 501 | +void dynarray_reset(void *pp, int *n) |
| 502 | 502 | { |
| 503 | 503 | void **p; |
| 504 | 504 | for (p = *(void***)pp; *n; ++p, --*n) |
| @@ -2030,7 +2030,10 @@ static int tcc_add_file_internal(TCCState *s1, const char *filename, int flags) · 1525 unmodified lines |
| 2030 | 2030 | |
| 2031 | 2031 | int tcc_add_file(TCCState *s, const char *filename) |
| 2032 | 2032 | { |
| 2033 | | − return tcc_add_file_internal(s, filename, AFF_PRINT_ERROR); |
| 2033 | + if (s->output_type == TCC_OUTPUT_PREPROCESS) |
| 2034 | + return tcc_add_file_internal(s, filename, AFF_PRINT_ERROR | AFF_PREPROCESS); |
| 2035 | + else |
| 2036 | + return tcc_add_file_internal(s, filename, AFF_PRINT_ERROR); |
| 2034 | 2037 | } |
| 2035 | 2038 | |
| 2036 | 2039 | int tcc_add_library_path(TCCState *s, const char *pathname) |