| @@ -2731,6 +2731,7 @@ static void preprocess(int is_bof) · 2730 unmodified lines |
| 2731 | define_undef(s); | 2731 | define_undef(s); |
| 2732 | break; | 2732 | break; |
| 2733 | case TOK_INCLUDE: | 2733 | case TOK_INCLUDE: |
| | 2734 | case TOK_INCLUDE_NEXT: |
| 2734 | ch = file->buf_ptr[0]; | 2735 | ch = file->buf_ptr[0]; |
| 2735 | /* XXX: incorrect if comments : use next_nomacro with a special mode */ | 2736 | /* XXX: incorrect if comments : use next_nomacro with a special mode */ |
| 2736 | skip_spaces(); | 2737 | skip_spaces(); |
| @@ -2807,8 +2808,12 @@ static void preprocess(int is_bof) · 70 unmodified lines |
| 2807 | buf1[size] = '\0'; | 2808 | buf1[size] = '\0'; |
| 2808 | pstrcat(buf1, sizeof(buf1), buf); | 2809 | pstrcat(buf1, sizeof(buf1), buf); |
| 2809 | f = tcc_open(s1, buf1); | 2810 | f = tcc_open(s1, buf1); |
| 2810 | if (f) | 2811 | if (f) { |
| 2811 | goto found; | 2812 | if (tok == TOK_INCLUDE_NEXT) |
| | 2813 | tok = TOK_INCLUDE; |
| | 2814 | else |
| | 2815 | goto found; |
| | 2816 | } |
| 2812 | } | 2817 | } |
| 2813 | if (s1->include_stack_ptr >= s1->include_stack + INCLUDE_STACK_SIZE) | 2818 | if (s1->include_stack_ptr >= s1->include_stack + INCLUDE_STACK_SIZE) |
| 2814 | error("#include recursion too deep"); | 2819 | error("#include recursion too deep"); |
| @@ -2824,8 +2829,12 @@ static void preprocess(int is_bof) · 9 unmodified lines |
| 2824 | pstrcat(buf1, sizeof(buf1), "/"); | 2829 | pstrcat(buf1, sizeof(buf1), "/"); |
| 2825 | pstrcat(buf1, sizeof(buf1), buf); | 2830 | pstrcat(buf1, sizeof(buf1), buf); |
| 2826 | f = tcc_open(s1, buf1); | 2831 | f = tcc_open(s1, buf1); |
| 2827 | if (f) | 2832 | if (f) { |
| 2828 | goto found; | 2833 | if (tok == TOK_INCLUDE_NEXT) |
| | 2834 | tok = TOK_INCLUDE; |
| | 2835 | else |
| | 2836 | goto found; |
| | 2837 | } |
| 2829 | } | 2838 | } |
| 2830 | error("include file '%s' not found", buf); | 2839 | error("include file '%s' not found", buf); |
| 2831 | f = NULL; | 2840 | f = NULL; |