From 54c80f42d4b3d27d9f2dde111a2333e7fdc24ee3 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 5 Apr 2011 01:53:32 +0200 Subject: [PATCH] OSX compilation bugs --- include/mitsuba/core/util.h | 10 ++++++++++ include/mitsuba/hw/nsglsession.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/include/mitsuba/core/util.h b/include/mitsuba/core/util.h index e6634e27..7e1afcbd 100644 --- a/include/mitsuba/core/util.h +++ b/include/mitsuba/core/util.h @@ -110,6 +110,11 @@ extern MTS_EXPORT_CORE int log2i(uint32_t value); /// Base-2 logarithm (64-bit integer version) extern MTS_EXPORT_CORE int log2i(uint64_t value); +/// Base-2 logarithm (size_t version) +inline int log2i(size_t value) { + return log2i((uint64_t) value); +} + /// Friendly modulo function (always positive) extern MTS_EXPORT_CORE int modulo(int a, int b); @@ -128,6 +133,11 @@ inline bool isPowerOfTwo(uint64_t i) { return (i & (i-1)) == 0; } +/// Check if an integer is a power of two (size_t version) +inline bool isPowerOfTwo(size_t i) { + return (i & (i-1)) == 0; +} + /// Round an integer to the next power of two extern MTS_EXPORT_CORE uint32_t roundToPowerOfTwo(uint32_t i); diff --git a/include/mitsuba/hw/nsglsession.h b/include/mitsuba/hw/nsglsession.h index 018567fe..3f9f6ad5 100644 --- a/include/mitsuba/hw/nsglsession.h +++ b/include/mitsuba/hw/nsglsession.h @@ -36,6 +36,9 @@ public: /// Shut the session down void shutdown(); + /// Process all events and call event callbacks + void processEvents(); + /** * \brief Process all events and call event callbacks. *