summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util.c8
-rw-r--r--wscript9
2 files changed, 13 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index 526bf9b..7980b74 100644
--- a/src/util.c
+++ b/src/util.c
@@ -14,8 +14,12 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _POSIX_SOURCE 1 /* for wordexp, fileno */
-#define _BSD_SOURCE 1 /* for realpath, symlink */
+#define _POSIX_C_SOURCE 1 /* for wordexp, fileno */
+#define _BSD_SOURCE 1 /* for realpath, symlink */
+
+#ifdef __APPLE__
+# define _DARWIN_C_SOURCE 1 /* for flock */
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/wscript b/wscript
index e712038..485afa8 100644
--- a/wscript
+++ b/wscript
@@ -80,20 +80,25 @@ def configure(conf):
autowaf.check_pkg(conf, 'lv2-lv2plug.in-ns-ext-state',
uselib_store='LV2_STATE', mandatory=False)
+ defines = ['_POSIX_C_SOURCE', '_BSD_SOURCE']
+ if Options.platform == 'darwin':
+ defines += ['_DARWIN_C_SOURCE']
+
conf.check_cc(function_name='wordexp',
header_name='wordexp.h',
- defines='_POSIX_SOURCE',
+ defines=defines,
define_name='HAVE_WORDEXP',
mandatory=False)
conf.check_cc(function_name='flock',
header_name='sys/file.h',
+ defines=defines,
define_name='HAVE_FLOCK',
mandatory=False)
conf.check_cc(function_name='fileno',
header_name='stdio.h',
- defines='_POSIX_SOURCE',
+ defines=defines,
define_name='HAVE_FILENO',
mandatory=False)