Skip to content

Commit

Permalink
Merge pull request #5216 from khng300/fix-compile
Browse files Browse the repository at this point in the history
Fix FreeBSD compilation when doing gmake
  • Loading branch information
pbalcer authored Apr 26, 2021
2 parents 1e2f172 + a3dd9e3 commit 8ad2e24
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/common/file_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* file_posix.c -- Posix versions of file APIs
*/

#ifndef __FreeBSD__
/* for O_TMPFILE */
#define _GNU_SOURCE
#endif

#include <errno.h>
#include <signal.h>
Expand Down
2 changes: 2 additions & 0 deletions src/common/os_deep_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* os_deep_linux.c -- Linux abstraction layer
*/

#ifndef __FreeBSD__
#define _GNU_SOURCE
#endif

#include <inttypes.h>
#include <fcntl.h>
Expand Down
2 changes: 1 addition & 1 deletion src/common/set.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* set.c -- pool set utilities
*/

#ifndef _GNU_SOURCE
#if !defined(_GNU_SOURCE) && !defined(__FreeBSD__)
#define _GNU_SOURCE
#endif

Expand Down
2 changes: 2 additions & 0 deletions src/common/set_badblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
/*
* set_badblocks.c - common part of implementation of bad blocks API
*/
#ifndef __FreeBSD__
#define _GNU_SOURCE
#endif

#include <fcntl.h>
#include <inttypes.h>
Expand Down
2 changes: 2 additions & 0 deletions src/core/os_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* os_posix.c -- abstraction layer for basic Posix functions
*/

#ifndef __FreeBSD__
#define _GNU_SOURCE
#endif

#include <fcntl.h>
#include <stdarg.h>
Expand Down
2 changes: 2 additions & 0 deletions src/core/os_thread_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* os_thread_posix.c -- Posix thread abstraction layer
*/

#ifndef __FreeBSD__
#define _GNU_SOURCE
#endif
#include <pthread.h>
#ifdef __FreeBSD__
#include <pthread_np.h>
Expand Down
1 change: 1 addition & 0 deletions src/core/util_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <fcntl.h>
#include <signal.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/libpmemobj/lane.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* lane.c -- lane implementation
*/

#ifndef _GNU_SOURCE
#if !defined(_GNU_SOURCE) && !defined(__FreeBSD__)
#define _GNU_SOURCE
#endif

Expand Down

0 comments on commit 8ad2e24

Please sign in to comment.