Darwin: alias off64_t to off_t in NATIVE_LARGE_FILES block#788
Open
jverkoey wants to merge 1 commit intodrolbr:masterfrom
Open
Darwin: alias off64_t to off_t in NATIVE_LARGE_FILES block#788jverkoey wants to merge 1 commit intodrolbr:masterfrom
jverkoey wants to merge 1 commit intodrolbr:masterfrom
Conversation
template_db/types.h has a #ifdef NATIVE_LARGE_FILES block that aliases ftruncate64/lseek64/open64 to their un-suffixed counterparts for platforms where glibc's *64 symbols aren't available (notably macOS). The off64_t type itself is still referenced by Raw_File::size(), Raw_File::resize(), Raw_File::seek(), so the block isn't sufficient to compile on Darwin -- Apple clang fails with: error: unknown type name 'off64_t'; did you mean 'off_t'? Adding a 'typedef off_t off64_t;' to the same guarded block fixes the build on macOS. off_t is 64-bit on all 64-bit Darwin targets, so this is semantically identical to the symbols the block already aliases. Activate via CPPFLAGS="-DNATIVE_LARGE_FILES" at configure time.
This was referenced Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing
#ifdef NATIVE_LARGE_FILESblock insrc/template_db/types.haliasesftruncate64,lseek64, andopen64so osm-3s can build against platforms without glibc's*64symbols (notably macOS).The
off64_ttype is still referenced — byRaw_File::size,Raw_File::resize,Raw_File::seek— so the block alone isn't sufficient on Darwin. Apple clang fails with:Adding
typedef off_t off64_t;to the same guarded block finishes the job.off_tis 64-bit on all 64-bit Darwin targets, so this is semantically identical to the symbols the block already aliases.Activate via
CPPFLAGS="-DNATIVE_LARGE_FILES"atconfiguretime (unchanged).Two companion PRs address other Darwin-specific issues I hit while running Overpass natively on Apple Silicon — separate so they can be reviewed independently: #789 (sun_len fix), #790 (Mmap → pread).