From 1ee5a68d76c237ff7fb03584d7d7ebce396ef0ee Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 9 Nov 2025 20:22:33 +0100 Subject: [PATCH] Use consistent defines for header availability --- libs/ardour/wscript | 2 +- libs/pbd/boost_debug.cc | 6 +++--- libs/pbd/cpus.cc | 2 +- libs/pbd/pbd/stacktrace.h | 8 ++++---- libs/pbd/stacktrace.cc | 2 +- libs/pbd/wscript | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 3126af2d15..9d24a5ae78 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -346,7 +346,7 @@ def configure(conf): conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False) conf.check(header_name='sys/statvfs.h', define_name='HAVE_SYS_STATVFS_H',mandatory=False) - conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False) + conf.check(header_name='unistd.h', define_name='HAVE_UNISTD_H',mandatory=False) have_sys_ioprio = conf.check_cc( msg="Checking for 'ioprio_set' syscall support", diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc index c9a9f58a30..29a0d4892b 100644 --- a/libs/pbd/boost_debug.cc +++ b/libs/pbd/boost_debug.cc @@ -19,7 +19,7 @@ #include "libpbd-config.h" -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H #include #endif @@ -47,7 +47,7 @@ std::ostream& operator<< (std::ostream& str, const Backtrace& bt) { return bt.pr Backtrace::Backtrace() { -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H size = ::backtrace (trace, 200); #endif } @@ -59,7 +59,7 @@ Backtrace::print (std::ostream& str) const size_t i; if (size) { -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H strings = ::backtrace_symbols (trace, size); #endif if (strings) { diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index f39c8a57de..a14389157f 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -83,7 +83,7 @@ PBD::hardware_concurrency() int count; size_t size=sizeof(count); return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count; -#elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN) +#elif defined(HAVE_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN) int const count=sysconf(_SC_NPROCESSORS_ONLN); return (count>0)?count:0; #elif defined(PLATFORM_WINDOWS) diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h index 9ea89f5b30..46b8ef5bb3 100644 --- a/libs/pbd/pbd/stacktrace.h +++ b/libs/pbd/pbd/stacktrace.h @@ -30,7 +30,7 @@ #include #include -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H #include #include #endif @@ -51,7 +51,7 @@ class /*LIBPBD_API*/ thing_with_backtrace public: thing_with_backtrace () { trace_twb(); -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H allocation_backtrace = new void*[50]; allocation_backtrace_size = backtrace (allocation_backtrace, 50); #else @@ -63,7 +63,7 @@ public: thing_with_backtrace (const thing_with_backtrace& other) { trace_twb(); -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H allocation_backtrace = new void*[50]; allocation_backtrace_size = backtrace (allocation_backtrace, 50); #else @@ -87,7 +87,7 @@ public: } static void peek_a_boo (std::ostream& stream) { -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H typename std::list*>::iterator x; for (x = all.begin(); x != all.end(); ++x) { char **strings; diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc index 8b3cab2c38..70379f053b 100644 --- a/libs/pbd/stacktrace.cc +++ b/libs/pbd/stacktrace.cc @@ -44,7 +44,7 @@ PBD::trace_twb () /* Obtain a backtrace and print it to stdout. */ -#ifdef HAVE_EXECINFO +#ifdef HAVE_EXECINFO_H #include diff --git a/libs/pbd/wscript b/libs/pbd/wscript index a2c429b63c..41a3fc0d08 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -104,8 +104,8 @@ def configure(conf): autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0', mandatory=True) autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2', mandatory=True) - conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO',mandatory=False) - conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False) + conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO_H',mandatory=False) + conf.check(header_name='unistd.h', define_name='HAVE_UNISTD_H',mandatory=False) conf.env.append_value('CFLAGS', "-D_POSIX_C_SOURCE=200809L") if not Options.options.ppc: conf.check_cc(