Commits

Palmer, 2E0EOL committed c3c1bc1

Fix because including stdlib.h from GNU autoconf check causes bail.

Comments (0)

Files changed (1)

 # define DAYBOTHREADS_C_IN_CPP extern "C"
 # define DAYBOTHREADS_PROTOTYPE_VOID
 
-# include <cstdlib>
-/* nb. bool is an instrinstic type in C++ */
-
 #else /* C */
 
 # define DAYBOTHREADS_C_IN_CPP
 # define DAYBOTHREADS_PROTOTYPE_VOID void
 
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# else
-#  include "dlstdinc.h"
-# endif /*HAVE_STDLIB_H*/
-
-# ifdef HAVE_STDBOOL_H
-#  include <stdbool.h>
-# else
-#  include "dlstdinc.h"
-# endif /*HAVE_STDBOOL_H*/
-
 #endif /*__cplusplus*/
 
 #ifdef DAYBOTHREADS_AUTO_INCLUDE
   /* Pull-in static definition of which back-end the lib was built against */
 # include "daybothreads-config.h"
 
+# ifdef __cplusplus
+
+#  include <cstdlib>
+   /* nb. bool is an instrinstic type in C++ */
+# else /* C */
+
+#  ifdef HAVE_STDLIB_H
+#   include <stdlib.h>
+#  else
+#   include "dlstdinc.h"
+#  endif /*HAVE_STDLIB_H*/
+
+#  ifdef HAVE_STDBOOL_H
+#   include <stdbool.h>
+#  else
+#   include "dlstdinc.h"
+#  endif /*HAVE_STDBOOL_H*/
+
+# endif /*__cplusplus*/
+
   /* Include the back-end, otherwise ptlock_t etc will fail */
 # if defined(DAYBOTHREADS_NT)
 #  include <windows.h>