Skip to content

Define TRUE/FALSE for plain C/C++ sources via ICU macro - #20

Merged
gcasa merged 2 commits into
masterfrom
copilot/fix-building-errors-c-c
Oct 4, 2026
Merged

gcasa merged 2 commits into
masterfrom
copilot/fix-building-errors-c-c

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Building ObjCSword with buildtool fails on its bundled ICU sources (e.g. ucnvbocu.cpp, ucnv_u7.c) with use of undeclared identifier 'FALSE' / 'TRUE'. Newer ICU no longer defines these by default, and plain C/C++ files don't pick them up from GNUstep's Objective-C headers.

Compile flags (XCode/PBXFileReference.m)

  • For sourcecode.c.c and sourcecode.cpp.cpp files, -DU_DEFINE_FALSE_AND_TRUE=1 is added to the compile command, so ICU defines TRUE/FALSE itself.
  • Objective-C and Objective-C++ files are unchanged.
# before
$CC ... -c dependencies/icu/source/common/ucnv_u7.c ...
# after
$CC ... -c dependencies/icu/source/common/ucnv_u7.c -DU_DEFINE_FALSE_AND_TRUE=1 ...

Review notes

  • The flag is ICU-specific. It's harmless to other C/C++ code, but it won't fix the same error from a different library.
  • Not built or run against ObjCSword, and no regression test added.

Copilot AI linked an issue Oct 4, 2026 that may be closed by this pull request
Co-authored-by: gcasa <27943+gcasa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix errors while building project with C and C++ code Define TRUE/FALSE for plain C/C++ sources via ICU macro Oct 4, 2026
Copilot AI requested a review from gcasa October 4, 2026 05:40
@gcasa
gcasa marked this pull request as ready for review October 4, 2026 05:42
@gcasa
gcasa merged commit a82af19 into master Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Errors while building project with C and C++ code

2 participants