summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_math.h
diff options
context:
space:
mode:
authorolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-05-21 13:06:48 +0000
committerolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-05-21 13:06:48 +0000
commit553942aa698b036f0de445f65902fb21097070bc (patch)
treee1b9a2d9584ae0d78a7ac72cae66d3c0bcf281fc /ACE/ace/OS_NS_math.h
parentc2b96a02a07b201d48040e6741b45ad44d90eb1d (diff)
downloadATCD-553942aa698b036f0de445f65902fb21097070bc.tar.gz
ChangeLogTag: Mon May 21 13:04:04 UTC 2007 Olli Savia <ops@iki.fi>
Diffstat (limited to 'ACE/ace/OS_NS_math.h')
-rw-r--r--ACE/ace/OS_NS_math.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/ACE/ace/OS_NS_math.h b/ACE/ace/OS_NS_math.h
index 83ffc601482..e1803d9e1a8 100644
--- a/ACE/ace/OS_NS_math.h
+++ b/ACE/ace/OS_NS_math.h
@@ -25,6 +25,8 @@
# pragma once
# endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "ace/os_include/os_math.h"
+
#include /**/ "ace/ACE_export.h"
#if defined (ACE_EXPORT_MACRO)
@@ -32,6 +34,23 @@
#endif
#define ACE_EXPORT_MACRO ACE_Export
+/*
+ * We inline and undef some functions that may be implemented
+ * as macros on some platforms. This way macro definitions will
+ * be usable later as there is no way to save the macro definition
+ * using the pre-processor.
+ *
+ */
+inline double ace_log2_helper (double x)
+{
+#if defined (log2)
+ return log2 (x);
+#undef log2
+#else
+ return ACE_STD_NAMESPACE::log2 (x);
+#endif /* defined (log2) */
+}
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE_OS
@@ -45,6 +64,10 @@ namespace ACE_OS
ACE_NAMESPACE_INLINE_FUNCTION
double ceil (double x);
+ /// This method computes base-2 logarithm of x
+ ACE_NAMESPACE_INLINE_FUNCTION
+ double log2 (double x);
+
} /* namespace ACE_OS */
ACE_END_VERSIONED_NAMESPACE_DECL