Skip to content

Commit

Permalink
FIX eclipse-omr#59 : Use GNU feature macros before including any syst…
Browse files Browse the repository at this point in the history
…em header files

Signed-off-by: Andrew Young <[email protected]>
  • Loading branch information
youngar committed Apr 5, 2016
1 parent b58fd61 commit c103034
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions port/linux/omrosbacktrace_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
* @brief Stack backtracing support
*/

#define _GNU_SOURCE

#include "omrport.h"
#include "omrportpriv.h"
#include "omrsignal_context.h"

#include <dlfcn.h>
#include <execinfo.h>
#include <string.h>
#include <stdlib.h>

#define __USE_GNU 1
#include <dlfcn.h>
#include <string.h>

#include "omrintrospect.h"

Expand Down
5 changes: 3 additions & 2 deletions port/linux386/omrsignal_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* Multiple authors (IBM Corp.) - initial API and implementation and/or initial documentation
*******************************************************************************/

#include <unistd.h>
#define __USE_GNU 1
#define _GNU_SOURCE

#include <sys/ucontext.h>
#include <unistd.h>

#include "omrport.h"
#include "omrsignal_context.h"
Expand Down
5 changes: 3 additions & 2 deletions port/linuxarm/omrsignal_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* Multiple authors (IBM Corp.) - initial API and implementation and/or initial documentation
*******************************************************************************/

#include <unistd.h>
#define __USE_GNU 1
#define _GNU_SOURCE

#include <sys/ucontext.h>
#include <unistd.h>

#include "omrport.h"
#include "omrsignal_context.h"
Expand Down
1 change: 0 additions & 1 deletion port/unix/omrintrospect.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#if defined(LINUX)
/* _GNU_SOURCE forces GLIBC_2.0 sscanf/vsscanf/fscanf for RHEL5 compatability */
#define _GNU_SOURCE
#define __USE_GNU 1
#endif /* defined(LINUX) */

#include <pthread.h>
Expand Down
2 changes: 1 addition & 1 deletion util/omrutil/unix/linux/s390/archinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* _GNU_SOURCE forces GLIBC_2.0 sscanf/vsscanf/fscanf for RHEL5 compatability */
#if defined(LINUX)
#define _GNU_SOURCE
#endif /* defined(__GNUC__) */
#endif /* defined(LINUX) */

#include <string.h>
#include <stdio.h>
Expand Down

0 comments on commit c103034

Please sign in to comment.