mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-08 00:30:03 -04:00
8b22ff001b
## Summary On macOS/Apple platforms, Objective-C++ defines `Nil` as a macro (`#define Nil nullptr` in `objc/objc.h`). Unreal Engine compiles all C++ as Objective-C++ on Apple platforms, so `FSpacetimeDBUuid::Nil()` in `Builtins.h` collides with this macro and produces: ``` error: expected member name or ';' after declaration specifiers; 'nullptr' is a keyword in Objective-C++ ``` Every UE project using the SpacetimeDB Unreal SDK on macOS hits this build failure. ## Affected platforms - macOS (any version) — Unreal Engine 5.x compiles as Objective-C++ on Apple platforms - Affects all SpacetimeDB Unreal SDK versions that expose `FSpacetimeDBUuid::Nil()` ## Reproduction steps 1. Create or open any Unreal Engine project on macOS 2. Add the SpacetimeDB Unreal SDK (v2.1.0) 3. Build the project 4. Observe the build failure in `Builtins.h` at `FSpacetimeDBUuid::Nil()` ## Fix Added `#pragma push_macro` / `#undef Nil` / `#pragma pop_macro` guards in `Builtins.h`: - **Before struct definitions**: Save and undefine the `Nil` macro so it doesn't interfere with `FSpacetimeDBUuid::Nil()` and any other identifiers using `Nil` - **After the last closing brace**: Restore the original `Nil` macro so downstream Objective-C++ translation units are unaffected This is the standard UE pattern for handling platform macro collisions (similar to how UE itself handles `check`, `verify`, `TEXT`, etc. macro conflicts). ## Test plan - [ ] Verify macOS UE build succeeds with the SDK included - [ ] Verify Windows/Linux builds are unaffected (the `#ifdef Nil` guard is a no-op when the macro is not defined) - [ ] Verify `FSpacetimeDBUuid::Nil()` and `NilUuid()` Blueprint functions work correctly at runtime 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Larabie <jason@clockworklabs.io>