# HG changeset patch # User Michael Goffioul # Date 1266775499 0 # Node ID 65d5776379c3b1bd054be8ab5f1ac25cfa9ebe3e # Parent 33b012d39dce14d975b651ae62e1ed0e2516afad Reduce the amount of stuff included by windows.h and avoid min/max being #define-d diff -r 33b012d39dce -r 65d5776379c3 ChangeLog --- a/ChangeLog Sun Feb 21 17:46:30 2010 +0000 +++ b/ChangeLog Sun Feb 21 18:04:59 2010 +0000 @@ -1,5 +1,7 @@ 2010-02-21 Michael Goffioul + * configure.ac: Define NOMINMAX under MSVC. + * configure.ac: Add pcre_config --cflags to XTRA_CXXFLAGS instead of CPPFLAGS. diff -r 33b012d39dce -r 65d5776379c3 configure.ac --- a/configure.ac Sun Feb 21 17:46:30 2010 +0000 +++ b/configure.ac Sun Feb 21 18:04:59 2010 +0000 @@ -430,6 +430,11 @@ AC_SUBST(XTRA_CFLAGS) AC_SUBST(XTRA_CXXFLAGS) +## Avoid #define of min/max from windows.h header +if test "$have_msvc" = "yes"; then + AC_DEFINE(NOMINMAX, 1, [Define if you want to avoid min/max macro definition in Windows headers]) +fi + ### Use -static if compiling on Alpha OSF/1 1.3 systems. case "$canonical_host_type" in diff -r 33b012d39dce -r 65d5776379c3 libcruft/ChangeLog --- a/libcruft/ChangeLog Sun Feb 21 17:46:30 2010 +0000 +++ b/libcruft/ChangeLog Sun Feb 21 18:04:59 2010 +0000 @@ -1,5 +1,7 @@ 2010-02-21 Michael Goffioul + * misc/quit.h: Define WIN32_LEAN_AND_MEAN and don't #undef min/max. + * Makefile.am: Add -bindir option to libcruft_la_LDFLAGS. 2010-02-17 John W. Eaton diff -r 33b012d39dce -r 65d5776379c3 libcruft/misc/quit.h --- a/libcruft/misc/quit.h Sun Feb 21 17:46:30 2010 +0000 +++ b/libcruft/misc/quit.h Sun Feb 21 18:04:59 2010 +0000 @@ -35,9 +35,8 @@ #if defined (__WIN32__) && ! defined (_POSIX_VERSION) +#define WIN32_LEAN_AND_MEAN #include -#undef min -#undef max CRUFT_API extern void w32_sigint_init (void); /* setup */ CRUFT_API extern void w32_raise_final (void); /* tear down */ diff -r 33b012d39dce -r 65d5776379c3 liboctave/ChangeLog --- a/liboctave/ChangeLog Sun Feb 21 17:46:30 2010 +0000 +++ b/liboctave/ChangeLog Sun Feb 21 18:04:59 2010 +0000 @@ -1,5 +1,9 @@ 2010-02-21 Michael Goffioul + * lo-sysdep.cc, lo-utils.h, oct-shlib.h: Define WIN32_LEAN_AND_MEAN + and don't #undef min/max. + * oct-inttypes.h: Don't #undef min/max. + * oct-glob.cc (octave_glob): Convert backslashes to forward slashes automatically before calling glob, and convert back after the call (implementation from jwe). diff -r 33b012d39dce -r 65d5776379c3 liboctave/lo-sysdep.cc --- a/liboctave/lo-sysdep.cc Sun Feb 21 17:46:30 2010 +0000 +++ b/liboctave/lo-sysdep.cc Sun Feb 21 18:04:59 2010 +0000 @@ -34,11 +34,8 @@ #include #if defined (__WIN32__) && ! defined (__CYGWIN__) +#define WIN32_LEAN_AND_MEAN #include -#ifdef max -# undef min -# undef max -#endif #endif #include "file-ops.h" diff -r 33b012d39dce -r 65d5776379c3 liboctave/lo-utils.h --- a/liboctave/lo-utils.h Sun Feb 21 17:46:30 2010 +0000 +++ b/liboctave/lo-utils.h Sun Feb 21 18:04:59 2010 +0000 @@ -114,13 +114,13 @@ octave_write_float_complex (std::ostream& os, const FloatComplex& cval); #ifdef HAVE_LOADLIBRARY_API +#define WIN32_LEAN_AND_MEAN #include extern "C" OCTAVE_API void * octave_w32_library_search (HINSTANCE handle, const char *name); -#undef min -#undef max -#endif #endif extern "C" OCTAVE_API pid_t octave_waitpid (pid_t pid, int *status, int options); + +#endif diff -r 33b012d39dce -r 65d5776379c3 liboctave/oct-inttypes.h --- a/liboctave/oct-inttypes.h Sun Feb 21 17:46:30 2010 +0000 +++ b/liboctave/oct-inttypes.h Sun Feb 21 18:04:59 2010 +0000 @@ -39,12 +39,6 @@ inline long double xisnan (long double x) { return xisnan (static_cast (x)); } #endif -// Undefine min/max if needed (this may happen under Windows) -#ifdef min -#undef min -#undef max -#endif - // FIXME -- we define this by our own because some compilers, such as // MSVC, do not provide std::abs (int64_t) and std::abs (uint64_t). In // the future, it should go away in favor of std::abs. diff -r 33b012d39dce -r 65d5776379c3 liboctave/oct-shlib.cc --- a/liboctave/oct-shlib.cc Sun Feb 21 17:46:30 2010 +0000 +++ b/liboctave/oct-shlib.cc Sun Feb 21 18:04:59 2010 +0000 @@ -50,9 +50,8 @@ #elif defined (HAVE_SHL_LOAD_API) #include #elif defined (HAVE_LOADLIBRARY_API) +#define WIN32_LEAN_AND_MEAN #include -#undef min -#undef max #endif } diff -r 33b012d39dce -r 65d5776379c3 src/ChangeLog --- a/src/ChangeLog Sun Feb 21 17:46:30 2010 +0000 +++ b/src/ChangeLog Sun Feb 21 18:04:59 2010 +0000 @@ -1,5 +1,8 @@ 2010-02-21 Michael Goffioul + * gl-render.h: Define WIN32_LEAN_AND_MEAN and don't #undef min/max. + * DLD-FUNCTIONS/fltk_backend.cc: Don't #undef min/max. + * sighandlers.cc (octave_set_signal_handler): Don't use SIGALRM unconditionally. diff -r 33b012d39dce -r 65d5776379c3 src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc Sun Feb 21 17:46:30 2010 +0000 +++ b/src/DLD-FUNCTIONS/fltk_backend.cc Sun Feb 21 18:04:59 2010 +0000 @@ -49,11 +49,6 @@ #include #include -#ifdef min -#undef min -#undef max -#endif - #include "cmd-edit.h" #include "lo-ieee.h" diff -r 33b012d39dce -r 65d5776379c3 src/gl-render.h --- a/src/gl-render.h Sun Feb 21 17:46:30 2010 +0000 +++ b/src/gl-render.h Sun Feb 21 18:04:59 2010 +0000 @@ -24,11 +24,8 @@ #define gl_render_h 1 #ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN #include -#ifdef max -# undef min -# undef max -#endif #endif #ifdef HAVE_GL_GL_H