aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--alc/helpers.cpp39
-rw-r--r--config.h.in9
3 files changed, 15 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aee11a10..760e0e6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -367,14 +367,9 @@ IF(HAVE_EMMINTRIN_H)
ENDIF()
-CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));
- int main() {return 0;}" HAVE_GCC_FORMAT)
-
CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H)
-CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H)
CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H)
-CHECK_INCLUDE_FILE(sys/sysconf.h HAVE_SYS_SYSCONF_H)
CHECK_INCLUDE_FILE(guiddef.h HAVE_GUIDDEF_H)
IF(NOT HAVE_GUIDDEF_H)
CHECK_INCLUDE_FILE(initguid.h HAVE_INITGUID_H)
diff --git a/alc/helpers.cpp b/alc/helpers.cpp
index aa9ca7ae..2aee6a2d 100644
--- a/alc/helpers.cpp
+++ b/alc/helpers.cpp
@@ -18,6 +18,9 @@
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
+/* Define this first since Windows' system headers may include headers affected
+ * by it (is it even still needed?).
+ */
#ifdef _WIN32
#ifdef __MINGW32__
#define _WIN32_IE 0x501
@@ -37,28 +40,6 @@
#include <mutex>
#include <string>
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_SYS_SYSCONF_H
-#include <sys/sysconf.h>
-#endif
-
-#ifdef HAVE_PROC_PIDPATH
-#include <libproc.h>
-#endif
-
-#ifdef __FreeBSD__
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-
-#ifndef _WIN32
-#include <unistd.h>
-#elif defined(_WIN32_IE)
-#include <shlobj.h>
-#endif
-
#include "alcmain.h"
#include "almalloc.h"
#include "alfstream.h"
@@ -72,6 +53,8 @@
#ifdef _WIN32
+#include <shlobj.h>
+
const PathNamePair &GetProcBinary()
{
static PathNamePair ret;
@@ -240,6 +223,15 @@ void SetRTPriority(void)
#else
+#include <sys/types.h>
+#include <unistd.h>
+#include <dirent.h>
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+#endif
+#ifdef HAVE_PROC_PIDPATH
+#include <libproc.h>
+#endif
#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__)
#include <pthread.h>
#include <sched.h>
@@ -327,8 +319,7 @@ const PathNamePair &GetProcBinary()
void al_print(FILE *logfile, const char *fmt, ...)
{
- va_list ap;
-
+ std::va_list ap;
va_start(ap, fmt);
vfprintf(logfile, fmt, ap);
va_end(ap);
diff --git a/config.h.in b/config.h.in
index 8beb13a4..60879df9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -74,9 +74,6 @@
/* Define to the size of a long int type */
#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
-/* Define if we have GCC's format attribute */
-#cmakedefine HAVE_GCC_FORMAT
-
/* Define if we have dlfcn.h */
#cmakedefine HAVE_DLFCN_H
@@ -86,18 +83,12 @@
/* Define if we have malloc.h */
#cmakedefine HAVE_MALLOC_H
-/* Define if we have dirent.h */
-#cmakedefine HAVE_DIRENT_H
-
/* Define if we have cpuid.h */
#cmakedefine HAVE_CPUID_H
/* Define if we have intrin.h */
#cmakedefine HAVE_INTRIN_H
-/* Define if we have sys/sysconf.h */
-#cmakedefine HAVE_SYS_SYSCONF_H
-
/* Define if we have guiddef.h */
#cmakedefine HAVE_GUIDDEF_H