Skip to content

Commit

Permalink
Fix using directive in Unistd.h to fix react native compilation e…
Browse files Browse the repository at this point in the history
…rror (#2248)

Summary:
- When using React Native 0.74.x, RCT-Folly is installed as a `Pod` dependency.
- When compiling the app for iOS using `xcodebuild`, the file `Unistd.h` gives compilation error "Unexpected type name 'off_t': expected expression".

![image](https://github.com/facebook/folly/assets/11807135/753a6147-ec74-44df-851d-e5f17190a0b6)

- Changing it to typedef makes this error go away, and the app compiles and runs correctly.

This might also fix: #2167 (comment)

Note: CLA is signed ✅

Pull Request resolved: #2248

Reviewed By: yfeldblum

Differential Revision: D59289182

Pulled By: Orvid

fbshipit-source-id: 16902e2f6f5f26f024c9b3889505c0803ccc81ff
  • Loading branch information
SagarSDagdu authored and facebook-github-bot committed Jul 11, 2024
1 parent a0aca4b commit 1e145f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/portability/Unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <unistd.h>

#if defined(__APPLE__) || defined(__EMSCRIPTEN__)
using off64_t = off_t;
typedef off_t off64_t;

off64_t lseek64(int fh, off64_t off, int orig);

Expand Down

0 comments on commit 1e145f2

Please sign in to comment.