]> git.lyx.org Git - lyx.git/blob - boost/boost/config/platform/win32.hpp
update from Boost CVS
[lyx.git] / boost / boost / config / platform / win32.hpp
1 //  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
2 //  distribute this software is granted provided this copyright notice appears
3 //  in all copies. This software is provided "as is" without express or implied
4 //  warranty, and with no claim as to its suitability for any purpose.
5
6 //  See http://www.boost.org for most recent version.
7
8 //  Win32 specific config options:
9
10 #define BOOST_PLATFORM "Win32"
11
12 #if defined BOOST_DECL_EXPORTS
13 #  if defined BOOST_DECL_IMPORTS
14 #     error Not valid to define both BOOST_DECL_EXPORTS and BOOST_DECL_IMPORTS
15 #  endif
16 #  define BOOST_DECL __declspec(dllexport)
17 #elif defined BOOST_DECL_IMPORTS
18 #  define BOOST_DECL __declspec(dllimport)
19 #else
20 #  define BOOST_DECL
21 #endif
22
23 #if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF)
24 #  define BOOST_NO_SWPRINTF
25 #endif
26
27 #ifndef BOOST_DISABLE_WIN32
28 //
29 // Win32 will normally be using native Win32 threads,
30 // but there is a pthread library avaliable as an option:
31 //
32 #ifndef BOOST_HAS_PTHREADS
33 #  define BOOST_HAS_WINTHREADS
34 #endif
35
36 // WEK: Added
37 #define BOOST_HAS_FTIME
38
39 #endif
40
41 //
42 // disable min/max macros:
43 //
44 #ifdef min
45 #  undef min
46 #endif
47 #ifdef max
48 #  undef max
49 #endif
50 #ifndef NOMINMAX
51 #  define NOMINMAX
52 #endif
53
54 #ifdef BOOST_MSVC
55 namespace std{
56   // Apparently, something in the Microsoft libraries requires the "long"
57   // overload, because it calls the min/max functions with arguments of
58   // slightly different type.  (If this proves to be incorrect, this
59   // whole "BOOST_MSVC" section can be removed.)
60   inline long min(long __a, long __b) {
61     return __b < __a ? __b : __a;
62   }
63   inline long max(long __a, long __b) {
64     return  __a < __b ? __b : __a;
65   }
66   // The "long double" overload is required, otherwise user code calling
67   // min/max for floating-point numbers will use the "long" overload.
68   // (SourceForge bug #495495)
69   inline long double min(long double __a, long double __b) {
70     return __b < __a ? __b : __a;
71   }
72   inline long double max(long double __a, long double __b) {
73     return  __a < __b ? __b : __a;
74   }
75 }
76 using std::min;
77 using std::max;
78 #     endif