Skip to content

Commit

Permalink
Wrap __USE_GNU flag with ifndef
Browse files Browse the repository at this point in the history
I'm getting some compile errors with PHP 8.2:

```
/home/builder/apm-agent-php/platform.c:40: error: "__USE_GNU" redefined [-Werror]
   40 | #define __USE_GNU
      |
In file included from /home/builder/apm-agent-php/platform.h:27,
                 from /home/builder/apm-agent-php/platform.c:20:
/usr/include/features.h:392: note: this is the location of the previous definition
  392 | # define __USE_GNU 1
      |
```

As mentioned in #1008 (comment) I think this might be a small bug with #1015.
  • Loading branch information
xyu committed Jul 6, 2023
1 parent bafdc27 commit 3147261
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agent/native/ext/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
# include <syslog.h>
# include <signal.h>
# include <errno.h>
#define __USE_GNU
#include <dlfcn.h>
# ifndef __USE_GNU
# define __USE_GNU
# endif
# include <dlfcn.h>
#endif

#if defined( ELASTIC_APM_PLATFORM_HAS_LIBUNWIND )
Expand Down

0 comments on commit 3147261

Please sign in to comment.