-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOCK_UPTIME_RAW
isn't always available on __APPLE__
#15957
Comments
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
github-actions
bot
added
the
inactive
Denotes the issue/PR has not seen activity in the last 90 days.
label
May 27, 2024
It doesn't look like this problem has gone away of its own accord; the offending code still seems to be present in the current version. |
adamnovak
added a commit
to adamnovak/protobuf
that referenced
this issue
May 28, 2024
This will fix protocolbuffers#15957 by not trying to use CLOCK_UPTIME_RAW if the feature test macros are not currently set to make it available. Since the build system is in charge of the feature test macros, and since this header might be included under any end user program's build system, we can't just #define the macros we would like.
github-actions
bot
removed
the
inactive
Denotes the issue/PR has not seen activity in the last 90 days.
label
May 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 76d05d4 and #15554, Protobuf tries to always use
CLOCK_UPTIME_RAW
if compiled for an__APPLE__
system:protobuf/src/google/protobuf/map.h
Lines 710 to 715 in 9c0d130
But that symbol isn't always defined. On my machine, the MacOSX 14.2 SDK
time.h
only defines it if!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
evaluates to true:And Protobuf doesn't seem to define the appropriate macros to enable non-POSIX Darwin features before it includes
time.h
:protobuf/src/google/protobuf/map.h
Lines 28 to 30 in 9c0d130
This leads to a build failure in my project, which defines
_POSIX_C_SOURCE
to get Posix 2008 features, but does not define_DARWIN_C_SOURCE
because it does not directly use Darwin extensions.Protobuf should either set the right macros for the features it needs itself, or else document the macros that user code must (or must not) define to build against Protobuf. Or, Protobuf should check the defined macros and use only features that will be available.
The text was updated successfully, but these errors were encountered: