MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / has_preprocessor_work

Function has_preprocessor_work

internal/cbm/preprocessor.cpp:17–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15extern "C" {
16
17static 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

Callers 1

cbm_preprocess_with_mapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected