octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSVC compiler support [patch 5]: Additional required definition


From: Michael Goffioul
Subject: MSVC compiler support [patch 5]: Additional required definition
Date: Tue, 17 Oct 2006 21:42:32 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Defines additional stuff for MSVC to get access to InitializeCriticalSectionAndSpinCount
and M_LN2, in the form of configure test.
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.526
diff -p -c -r1.526 configure.in
*** configure.in        13 Oct 2006 18:11:26 -0000      1.526
--- configure.in        17 Oct 2006 11:07:41 -0000
*************** AC_CHECK_FUNCS(atexit basename bcopy bze
*** 1278,1283 ****
--- 1348,1375 ----
  
  OCTAVE_SMART_PUTENV
  
+ case "$canonical_host_type" in
+   *-*-msdos)
+     AC_MSG_CHECKING([for required _WIN32_WINNT])
+     AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
+ #include <windows.h>
+ #if _WIN32_WINNT < 0x0403
+ #error "Wrong version"
+ #endif]], []),
+       AC_MSG_RESULT([none]), [
+               AC_DEFINE(_WIN32_WINNT, 0x0403, [Define to 0x0403 to access 
InitializeCriticalSectionAndSpinCount])
+               AC_MSG_RESULT([0x0403])])
+     AC_MSG_CHECKING([whether _USE_MATH_DEFINES needs to be defined])
+     AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <math.h>]],
+ [[int x = M_LN2;]]),
+       AC_MSG_RESULT([no]), [
+               AC_DEFINE(_USE_MATH_DEFINES, 1, [Define if your system needs it 
to define math constants like M_LN2])
+               AC_MSG_RESULT([yes])])
+     #AC_DEFINE_UNQUOTED(_WIN32_WINNT, [0x0403], [Define to 0x0403 to access 
InitializeCriticalSectionAndSpinCount (Win32)])
+     #AC_DEFINE(_USE_MATH_DEFINES, 1, [Define to access M_LN2 constant 
(Win32)])
+   ;;
+ esac
+ 
  ### Dynamic linking is now enabled only if we are building shared
  ### libs and some API for dynamic linking is detected.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]