Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1901 - in trunk/Core: Exceptions Geometry Thread Util
- Date: Mon, 3 Dec 2007 19:15:07 -0700 (MST)
Author: boulos
Date: Mon Dec 3 19:15:01 2007
New Revision: 1901
Modified:
trunk/Core/Exceptions/StackWalker.cc
trunk/Core/Exceptions/StackWalker.h
trunk/Core/Geometry/BBox.h
trunk/Core/Thread/Thread.cc
trunk/Core/Thread/Thread_win32.cc
trunk/Core/Thread/Time_win32.cc
trunk/Core/Util/Align.h
trunk/Core/Util/Plugin.h
trunk/Core/Util/Preprocessor.h
trunk/Core/Util/Timer.cc
Log:
Changing order of include for Plugin.h in Factory.cc to avoid annoying
min/max macro garbage. Anything that includes <windows.h> needs to go after
anything useful...
Adding WIN32_LEAN_AND_MEAN everywhere just in case we'd like to avoid all its
terrible ness.
Adding another case for MSC for MANTA_ALIGN (it doesn't like the "extra" pair
of parentheses, so only use constant expressions for MANTA_ALIGN).
Adding a MANTA_PLUGINEXPORT to Preprocessor.h, which should be used instead
of a manual extern "C" for make_scene and make_stack functions inside of
libraries.
bin/manta.exe now runs with -nodisplaybench (3 fps in debug mode under VMware
fusion). Unfortunately the MS Compiler can't handle KDTree.cc in release
mode, so I can't report a release mode performance.
About.cc does not work on Win32 and needs to be updated.
Modified: trunk/Core/Exceptions/StackWalker.cc
==============================================================================
--- trunk/Core/Exceptions/StackWalker.cc (original)
+++ trunk/Core/Exceptions/StackWalker.cc Mon Dec 3 19:15:01 2007
@@ -23,6 +23,7 @@
* 2005-08-05 v5 - Removed most Lint (
http://www.gimpel.com/)
errors... thanks to Okko Willeboordse!
*
**********************************************************************/
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
Modified: trunk/Core/Exceptions/StackWalker.h
==============================================================================
--- trunk/Core/Exceptions/StackWalker.h (original)
+++ trunk/Core/Exceptions/StackWalker.h Mon Dec 3 19:15:01 2007
@@ -11,7 +11,7 @@
// #pragma once is supported starting with _MCS_VER 1000,
// so we need not to check the version (because we only support _MSC_VER >=
1100)!
#pragma once
-
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// special defines for VC5/6 (if no actual PSDK is installed):
Modified: trunk/Core/Geometry/BBox.h
==============================================================================
--- trunk/Core/Geometry/BBox.h (original)
+++ trunk/Core/Geometry/BBox.h Mon Dec 3 19:15:01 2007
@@ -4,7 +4,7 @@
#include <Core/Geometry/Vector.h>
#include <Core/Math/Expon.h>
-
+#define WIN32_LEAN_AND_MEAN
#include <limits>
namespace Manta {
Modified: trunk/Core/Thread/Thread.cc
==============================================================================
--- trunk/Core/Thread/Thread.cc (original)
+++ trunk/Core/Thread/Thread.cc Mon Dec 3 19:15:01 2007
@@ -62,6 +62,7 @@
#include <string.h>
#include <sys/types.h>
#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winnt.h>
#include <io.h>
Modified: trunk/Core/Thread/Thread_win32.cc
==============================================================================
--- trunk/Core/Thread/Thread_win32.cc (original)
+++ trunk/Core/Thread/Thread_win32.cc Mon Dec 3 19:15:01 2007
@@ -60,6 +60,7 @@
#define __REENTRANT
#define _WINSOCK2API_
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <excpt.h>
#include <signal.h>
Modified: trunk/Core/Thread/Time_win32.cc
==============================================================================
--- trunk/Core/Thread/Time_win32.cc (original)
+++ trunk/Core/Thread/Time_win32.cc Mon Dec 3 19:15:01 2007
@@ -33,6 +33,7 @@
#include <Core/Thread/Thread.h>
#include <Core/Thread/ThreadError.h>
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Mmsystem.h> // windows time functions
#include <errno.h>
Modified: trunk/Core/Util/Align.h
==============================================================================
--- trunk/Core/Util/Align.h (original)
+++ trunk/Core/Util/Align.h Mon Dec 3 19:15:01 2007
@@ -30,12 +30,15 @@
#define _CORE_UTIL_ALIGN__H
-#if defined (__INTEL_COMPILER)
+#if defined (__INTEL_COMPILER)
#define MANTA_ALIGN(size) \
- __declspec( align( (size) ) )
+ __declspec(align((size)))
#elif defined (__GNUC__)
#define MANTA_ALIGN(size) \
__attribute__ ((aligned (size)))
+#elif defined (_MSC_VER)
+#define MANTA_ALIGN(size) \
+ __declspec(align(size))
#else
#define MANTA_ALIGN(size)
#endif
Modified: trunk/Core/Util/Plugin.h
==============================================================================
--- trunk/Core/Util/Plugin.h (original)
+++ trunk/Core/Util/Plugin.h Mon Dec 3 19:15:01 2007
@@ -4,7 +4,8 @@
#include <string.h>
#include <string>
#include <iostream>
-#ifdef WIN32
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#elif defined(__APPLE__)
// NOTE(boulos): We should also not take this path but use dlfcn if
@@ -27,7 +28,7 @@
memset(name, 0, sizeof(name));
strncpy(name, plugin_name, sizeof(name));
// load the shared object
-#ifdef WIN32
+#ifdef _WIN32
object = LoadLibrary(name);
if (!object)
throw InputError("Can't open plugin: " + std::string(name));
@@ -44,7 +45,7 @@
}
~Plugin() {
-#ifdef WIN32
+#ifdef _WIN32
if (object)
FreeLibrary(object);
#elif defined(__APPLE__)
@@ -58,7 +59,7 @@
bool loadSymbol(const char* symbol) {
void* address = NULL;
-#ifdef WIN32
+#ifdef _WIN32
address = (void*)GetProcAddress(object, symbol);
#elif defined(__APPLE__)
// NOTE(boulos): Thanks to incredible smarts, the symbols in
@@ -82,7 +83,7 @@
}
char name[1024];
-#ifdef WIN32
+#ifdef _WIN32
typedef HMODULE DSOType;
#elif defined(__APPLE__)
typedef const struct mach_header* DSOType;
Modified: trunk/Core/Util/Preprocessor.h
==============================================================================
--- trunk/Core/Util/Preprocessor.h (original)
+++ trunk/Core/Util/Preprocessor.h Mon Dec 3 19:15:01 2007
@@ -29,5 +29,10 @@
// Stack allocation equivalent to type[size]
#define MANTA_STACK_ALLOC(type, size) ((type*)alloca((size) * sizeof(type)))
+#if defined(_WIN32)
+#define MANTA_PLUGINEXPORT extern "C" __declspec(dllexport)
+#else
+#define MANTA_PLUGINEXPORT extern "C"
+#endif
#endif // MANTA_CORE_UTIL_MANTA_PREPROCESSOR_H_
Modified: trunk/Core/Util/Timer.cc
==============================================================================
--- trunk/Core/Util/Timer.cc (original)
+++ trunk/Core/Util/Timer.cc Mon Dec 3 19:15:01 2007
@@ -52,6 +52,7 @@
#include <sys/resource.h>
#include <unistd.h>
#else
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <limits.h>
- [Manta] r1901 - in trunk/Core: Exceptions Geometry Thread Util, boulos, 12/03/2007
Archive powered by MHonArc 2.6.16.