--- liboctave/lo-specfun.cc
+++ liboctave/lo-specfun.cc
@@ -25,6 +25,12 @@
 #include <config.h>
 #endif
 
+#if !defined (_REENTRANT)
+#define _REENTRANT
+#endif
+#include <cmath>
+#undef _REENTRANT
+
 #include "Range.h"
 #include "CColVector.h"
 #include "CMatrix.h"
