Opened 5 years ago

Last modified 5 years ago

#13274 new Bugs

boost.filesystem compile problem on Android

Reported by: Berkus <berkus@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:

Description

Hello, in attempt to build boost for android with more or less reasonable strict settings (-Werror) I uncovered some bugs which I cannot report on github because these projects have Issues disabled.

/usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/android/support/include/stdio.h:36:25: error: invalid token at start of a p
reprocessor expression
#if __USE_FILE_OFFSET64 && __ANDROID_API__ < __ANDROID_API_N__

This happens because filesystem defines a "harmless" macro:

libs/filesystem/src/operations.cpp:18:9: warning: '__USE_FILE_OFFSET64' macro redefined [-Wmacro-redefined]
#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX
        ^

While this check was #if defined(__USE_FILE_OFFSET64) in previous android versions, it seems to have changed when they introduced unified headers. It's probably more "harmless" to define an integer value in boost.filesystem rather than persuade Google to fix their code.

Change History (3)

comment:1 by Berkus <berkus@…>, 5 years ago

This is using clang toolchain on Android NDK r16 beta1.

Reference to user-config.jam for the build

comment:3 by anonymous, 5 years ago

this bug can be closed: the released NDK added the missing defined() last year.

Note: See TracTickets for help on using tickets.