Commit ef7fe65
PR #102674: Fix TensorFlow Lite build error with Android NDK (#102572)
Imported from GitHub PR tensorflow/tensorflow#102674
Fix TensorFlow Lite build error with Android NDK (tensorflow/tensorflow#102572)
Guard sys/types.h include to prevent build failures on Windows and
certain Android NDK configurations.
The file_util.h header unconditionally included <sys/types.h>, which
is not available or doesn't properly define off_t on Windows. Since
the code already handles Windows separately by using __int64 for the
Offset type alias instead of off_t, the sys/types.h include is only
needed on POSIX systems.
This fix adds a platform guard to only include sys/types.h on
non-Windows platforms, preventing compilation errors when building
TensorFlow Lite for Android with CMake and Android NDK.
Fixes tensorflow/tensorflow#102572
Copybara import of the project:
--
ef974d25fa30a0b21fbb09f34a58a8f95dc3a69e by jameslovespancakes <jmlenhard@wm.edu>:
Fix TensorFlow Lite build error with Android NDK (#102572)
Guard sys/types.h include to prevent build failures on Windows and
certain Android NDK configurations.
The file_util.h header unconditionally included <sys/types.h>, which
is not available or doesn't properly define off_t on Windows. Since
the code already handles Windows separately by using __int64 for the
Offset type alias instead of off_t, the sys/types.h include is only
needed on POSIX systems.
This fix adds a platform guard to only include sys/types.h on
non-Windows platforms, preventing compilation errors when building
TensorFlow Lite for Android with CMake and Android NDK.
Fixes #102572
Merging this change closes #102674
FUTURE_COPYBARA_INTEGRATE_REVIEW=tensorflow/tensorflow#102674 from jameslovespancakes:fix-tflite-android-ndk-build ef974d25fa30a0b21fbb09f34a58a8f95dc3a69e
PiperOrigin-RevId: 8226516951 parent 662cdbf commit ef7fe65
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
0 commit comments