| 15 | extern "C" { |
| 16 | |
| 17 | static bool has_preprocessor_work(const char *source, int source_len) { |
| 18 | if (!source || source_len <= 0) { |
| 19 | return false; |
| 20 | } |
| 21 | for (int i = 0; i < source_len - 1; i++) { |
| 22 | if (source[i] == '#') { |
| 23 | // Skip whitespace after # |
| 24 | int j = i + 1; |
| 25 | while (j < source_len && (source[j] == ' ' || source[j] == '\t')) |
| 26 | j++; |
| 27 | int remaining = source_len - j; |
| 28 | if (remaining >= 6 && strncmp(source + j, "define", 6) == 0) { |
| 29 | return true; |
| 30 | } |
| 31 | if (remaining >= 5 && strncmp(source + j, "ifdef", 5) == 0) { |
| 32 | return true; |
| 33 | } |
| 34 | if (remaining >= 6 && strncmp(source + j, "ifndef", 6) == 0) { |
| 35 | return true; |
| 36 | } |
| 37 | if (remaining >= 3 && strncmp(source + j, "if ", 3) == 0) { |
| 38 | return true; |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | return false; |
| 43 | } |
| 44 | |
| 45 | // ── Export-macro candidates (#1989) ───────────────────────────────────────── |
| 46 | // Build systems define symbol-export macros empty on the compiler command line |
no outgoing calls
no test coverage detected