I need to use the 64-bit Linux blender, but I don't want to accidentally
authorChris Want <cwant@ualberta.ca>
Tue, 23 Jan 2007 20:08:23 +0000 (20:08 +0000)
committerChris Want <cwant@ualberta.ca>
Tue, 23 Jan 2007 20:08:23 +0000 (20:08 +0000)
commit creator.c, so if this file is compiled and the macro YESIAMSTUPID
is defined, the executable will run, with a mean warning printed to stdout.
Enable in cmake by setting YESIAMSTUPID to On, or with make by putting
"export NAN_YESIAMSTUPID=true" in user-def.mk.

CMakeLists.txt
source/creator/CMakeLists.txt
source/creator/Makefile
source/creator/creator.c

index 180e3edd46862440adfb37bb72456982aa0b38ba..121dbd2814ee92ab35d035c2744da4dd51fe52c5 100644 (file)
@@ -66,6 +66,7 @@ OPTION(WITH_QUICKTIME         "Enable Quicktime Support"                              OFF)
 OPTION(WITH_OPENEXR            "Enable OpenEXR Support (http://www.openexr.com)"       OFF)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
 OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)" ON)
+OPTION(YESIAMSTUPID            "Enable execution on 64-bit platforms"                                  OFF)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
index 08dbba4988a50ed3c35b1fee5650c883af69d3ee..938fb2804bd321ed202154037e80b85a11afb8a0 100644 (file)
@@ -47,6 +47,10 @@ IF(WITH_QUICKTIME)
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
+IF(YESIAMSTUPID)
+  ADD_DEFINITIONS(-DYESIAMSTUPID)
+ENDIF(YESIAMSTUPID)
+
 MESSAGE(STATUS "Configuring blender")
 
 ADD_CUSTOM_COMMAND(
index 1074adf9b2bc7364551dd883b2179a4a5ffac2b9..f68855af96fec3da5f0232abc4cb9cd9e6728bda 100644 (file)
@@ -63,4 +63,8 @@ ifeq ($(WITH_QUICKTIME), true)
        CPPFLAGS += -I$(NAN_QUICKTIME)/include -DWITH_QUICKTIME
 endif
 
+ifeq ($(NAN_YESIAMSTUPID), true)
+       CPPFLAGS += -DYESIAMSTUPID
+endif
+
 CPPFLAGS += -I$(OPENGL_HEADERS)
index 37df17e3bad2c869b6f0a86c4887f2186ff3757c..25d3c9ce88b93abae9606509a708934dab52e031 100644 (file)
@@ -235,6 +235,7 @@ int main(int argc, char **argv)
        int audio = 0;
 #endif
 
+#ifndef YESIAMSTUPID
        /* temporary: prevent people to make/use 64 bits versions without them knowing it might be
                risky. I don't know for sure yet if we get problems, but I rather not get the burden of
                having to fix all faulty saved 64 bits files (ton) */
@@ -242,6 +243,14 @@ int main(int argc, char **argv)
                printf("64 bits compiles will give incorrectly saved .blend files. Do not use it. For testing purposes please remove this line from creator.c\n"); 
                exit(0);
        }
+#else
+       if(sizeof(void *)==8) {
+               printf("64 bits compiles will give incorrectly saved .blend files. Do not use it.\n\n"
+       "*** If you continue to run this executable, you really are quite stupid ***\n\n"); 
+
+       }
+
+#endif
 
        setCallbacks();
 #ifdef __APPLE__