Revision: 94b799514f06
Author: Nicolas Rougier <
Nicolas...@inria.fr>
Date: Wed Apr 10 23:19:20 2013
Log: Fix c_pointer (#27)
http://code.google.com/p/glumpy/source/detail?r=94b799514f06
Modified:
/glumpy/atb/raw.py
=======================================
--- /glumpy/atb/raw.py Tue Jun 22 10:48:05 2010
+++ /glumpy/atb/raw.py Wed Apr 10 23:19:20 2013
@@ -6,6 +6,7 @@
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
+import sys
import ctypes, ctypes.util
from ctypes import c_int, c_char_p, c_void_p, py_object, c_char
from constants import *
@@ -48,9 +49,14 @@
TwEventSpecialGLUT = __dll__.TwEventSpecialGLUT
TwEventMouseWheelGLUT = __dll__.TwMouseWheel
-# On Mac OS Snow Leopard, the following definitions seems to be necessary
to
-# ensure 64bits pointers anywhere needed
-c_pointer = ctypes.c_ulonglong
+#detect 64bit
+if (sys.maxsize > 2**32):
+ # On Mac OS Snow Leopard, the following definitions seems to be
necessary to
+ # ensure 64bits pointers anywhere needed
+ c_pointer = ctypes.c_ulonglong
+else:
+ #normal
+ c_pointer = ctypes.c_void_p
# In case of problem, this definition must be used
#c_pointer = ctypes.c_void_p