Unified · Split
| @@ -6,6 +6,36 @@ int main() · 5 unmodified lines | |||
| 6 | #include "18_include.h" | 6 | #include "18_include.h" |
| 7 | printf("done\n"); | 7 | printf("done\n"); |
| 8 | 8 | ||
| 9 | #define INC "18_include.h" | ||
| 10 | |||
| 11 | #ifdef __has_include | ||
| 12 | #if defined __has_include | ||
| 13 | #if __has_include("18_include.h") | ||
| 14 | printf("has_include\n"); | ||
| 15 | #endif | ||
| 16 | #if __has_include(INC) | ||
| 17 | printf("has_include\n"); | ||
| 18 | #endif | ||
| 19 | #if __has_include("not_found_18_include.h") | ||
| 20 | printf("has_include not found\n"); | ||
| 21 | #endif | ||
| 22 | #endif | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #ifdef __has_include_next | ||
| 26 | #if defined __has_include_next | ||
| 27 | #if __has_include_next("18_include.h") | ||
| 28 | printf("has_include_next\n"); | ||
| 29 | #endif | ||
| 30 | #if __has_include_next(INC) | ||
| 31 | printf("has_include_next\n"); | ||
| 32 | #endif | ||
| 33 | #if __has_include_next("not_found_18_include.h") | ||
| 34 | printf("has_include_next not found\n"); | ||
| 35 | #endif | ||
| 36 | #endif | ||
| 37 | #endif | ||
| 38 | |||
| 9 | return 0; | 39 | return 0; |
| 10 | } | 40 | } |
| 11 | 41 | ||
| @@ -1,3 +1,7 @@ | |||
| 1 | including | 1 | including |
| 2 | included | 2 | included |
| 3 | done | 3 | done |
| 4 | has_include | ||
| 5 | has_include | ||
| 6 | has_include_next | ||
| 7 | has_include_next | ||