summaryrefslogtreecommitdiffstats
path: root/src/sat/glucose/System.h
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2017-11-23 23:32:44 -0800
committerBaruch Sterin <baruchs@gmail.com>2017-11-23 23:32:44 -0800
commit7bcfe6436938d8354f499522b3d013229931b009 (patch)
tree1342cd4aef4079c926d546fa96e83e4d29d48f89 /src/sat/glucose/System.h
parentd438d9c1b6195806f74c5867c53518988a5e8d5c (diff)
downloadabc-7bcfe6436938d8354f499522b3d013229931b009.tar.gz
abc-7bcfe6436938d8354f499522b3d013229931b009.tar.bz2
abc-7bcfe6436938d8354f499522b3d013229931b009.zip
C++ comaptibility: add namespace support to Glucose
Diffstat (limited to 'src/sat/glucose/System.h')
-rw-r--r--src/sat/glucose/System.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sat/glucose/System.h b/src/sat/glucose/System.h
index a7f8c93d..5529af95 100644
--- a/src/sat/glucose/System.h
+++ b/src/sat/glucose/System.h
@@ -27,6 +27,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#include "sat/glucose/IntTypes.h"
+ABC_NAMESPACE_CXX_HEADER_START
+
//-------------------------------------------------------------------------------------------------
namespace Gluco {
@@ -37,24 +39,35 @@ extern double memUsedPeak(); // Peak-memory in mega bytes (returns 0 for
}
+ABC_NAMESPACE_CXX_HEADER_END
+
//-------------------------------------------------------------------------------------------------
// Implementation of inline functions:
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <time.h>
+ABC_NAMESPACE_CXX_HEADER_START
+
static inline double Gluco::cpuTime(void) { return (double)clock() / CLOCKS_PER_SEC; }
+ABC_NAMESPACE_CXX_HEADER_END
+
+
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
+ABC_NAMESPACE_CXX_HEADER_START
+
static inline double Gluco::cpuTime(void) {
struct rusage ru;
getrusage(RUSAGE_SELF, &ru);
return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000; }
+ABC_NAMESPACE_CXX_HEADER_END
+
#endif
#endif