Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Numeric_Limits.h
blobbcb140aa154f1d2da950ab9eb26853154c4a0801
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Numeric_Limits.h
7 * Traits containing basic integer limits. Useful for template-based
8 * code on platforms that lack @c std::numeric_limits<>.
10 * @note These traits are not meant to be a replacement for
11 * @c std::numeric_limits<>. Rather they are a crutch until all
12 * ACE-supported platforms also support
13 * @c std::numeric_limits<>.
15 * @internal Only meant for internal use by ACE.
16 * @deprecated This header will be removed once all platforms
17 * supported by ACE support @c std::numeric_limits<>.
19 * @author Ossama Othman <ossama_othman at symantec dot com>
21 //=============================================================================
23 #ifndef ACE_NUMERIC_LIMITS_H
24 #define ACE_NUMERIC_LIMITS_H
26 #include /**/ "ace/pre.h"
28 #include /**/ "ace/ACE_export.h"
30 #if !defined (ACE_LACKS_PRAGMA_ONCE)
31 # pragma once
32 #endif /* ACE_LACKS_PRAGMA_ONCE */
34 #if defined __MINGW32__
35 // Windows defines min/max macros that interfere with the
36 // numeric_limits::min/max() traits. Undefine those macros before
37 // including <limits>.
39 // Ideally, we could prevent those macros from being defined by
40 // defining the Windows-specific NOMINMAX symbol before any Windows
41 // headers are included, preferably on the command line. However,
42 // that would probably break some applications.
44 // @@ Why isn't this a problem with MSVC++ and Borland builds?
45 # undef min
46 # undef max
47 #endif /* __MINGW32__ */
49 #include <limits>
51 // Address global namespace pollution potentially incurred by some
52 // platforms.
53 #undef min
54 #undef max
56 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
58 // std::numeric_limits<> has all of the necessary specializations.
59 // Just wrap it.
60 template <typename T>
61 struct ACE_Numeric_Limits
63 static const T min () { return std::numeric_limits<T>::min (); }
64 static const T max () { return std::numeric_limits<T>::max (); }
67 ACE_END_VERSIONED_NAMESPACE_DECL
69 #include /**/ "ace/post.h"
71 #endif /* ACE_NUMERIC_LIMITS_H */