Use consistent defines for header availability

This commit is contained in:
Robin Gareus 2025-11-09 20:22:33 +01:00
parent 83d44860e0
commit 1ee5a68d76
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 12 additions and 12 deletions

View file

@ -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",

View file

@ -19,7 +19,7 @@
#include "libpbd-config.h"
#ifdef HAVE_EXECINFO
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#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) {

View file

@ -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)

View file

@ -30,7 +30,7 @@
#include <glibmm/threads.h>
#include <list>
#ifdef HAVE_EXECINFO
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#include <cstdlib>
#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<T>& 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<thing_with_backtrace<T>*>::iterator x;
for (x = all.begin(); x != all.end(); ++x) {
char **strings;

View file

@ -44,7 +44,7 @@ PBD::trace_twb ()
/* Obtain a backtrace and print it to stdout. */
#ifdef HAVE_EXECINFO
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>

View file

@ -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(