Skip to content

Fix gitstatus build failure with Apple Clang 17 (Xcode 16+)#19

Open
alejandroqh wants to merge 1 commit intoquantumnic:masterfrom
alejandroqh:fix/darwin-clang17-zlib
Open

Fix gitstatus build failure with Apple Clang 17 (Xcode 16+)#19
alejandroqh wants to merge 1 commit intoquantumnic:masterfrom
alejandroqh:fix/darwin-clang17-zlib

Conversation

@alejandroqh
Copy link

Apple Clang 17 predefines TARGET_OS_MAC=1, which activates an ancient classic Mac OS code path in the bundled zlib. The fdopen macro replaces the system _stdio.h declaration of fdopen() with NULL, producing a parse error.

Error:

  _stdio.h:322:7: error: expected identifier or '('
    FILE *fdopen(int, const char *) ...

  zutil.h:140:33: note: expanded from macro 'fdopen'
    #define fdopen(fd,mode) NULL /* No fdopen() */

Fix: use system zlib instead of the bundled one.

  • Add -lz to gitstatus_ldlibs to link against system zlib
  • Add -DUSE_BUNDLED_ZLIB=OFF to libgit2 cmake flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant