Browse Source

SIMPLE_STRUCT_POINTERS

David Rose 24 years ago
parent
commit
4af11e035c
4 changed files with 28 additions and 0 deletions
  1. 8 0
      dtool/Config.Irix.pp
  2. 8 0
      dtool/Config.Linux.pp
  3. 8 0
      dtool/Config.Win32.pp
  4. 4 0
      dtool/LocalSetup.pp

+ 8 - 0
dtool/Config.Irix.pp

@@ -20,6 +20,14 @@
 // Does the C++ compiler support ios::binary?
 #define HAVE_IOS_BINARY
 
+// Will the compiler avoid inserting extra bytes in structs between a
+// base struct and its derived structs?  It is safe to define this
+// true if you don't know, but if you know that you can get away with
+// this you may gain a tiny performance gain by defining this false.
+// If you define this false incorrectly, you will get lots of
+// assertion failures on execution.
+#define SIMPLE_STRUCT_POINTERS
+
 // Do we have a gettimeofday() function?
 #define HAVE_GETTIMEOFDAY 1
 

+ 8 - 0
dtool/Config.Linux.pp

@@ -20,6 +20,14 @@
 // Does the C++ compiler support ios::binary?
 #define HAVE_IOS_BINARY 1
 
+// Will the compiler avoid inserting extra bytes in structs between a
+// base struct and its derived structs?  It is safe to define this
+// true if you don't know, but if you know that you can get away with
+// this you may gain a tiny performance gain by defining this false.
+// If you define this false incorrectly, you will get lots of
+// assertion failures on execution.
+#define SIMPLE_STRUCT_POINTERS 1
+
 // Do we have a gettimeofday() function?
 #define HAVE_GETTIMEOFDAY 1
 

+ 8 - 0
dtool/Config.Win32.pp

@@ -20,6 +20,14 @@
 // Does the C++ compiler support ios::binary?
 #define HAVE_IOS_BINARY 1
 
+// Will the compiler avoid inserting extra bytes in structs between a
+// base struct and its derived structs?  It is safe to define this
+// true if you don't know, but if you know that you can get away with
+// this you may gain a tiny performance gain by defining this false.
+// If you define this false incorrectly, you will get lots of
+// assertion failures on execution.
+#define SIMPLE_STRUCT_POINTERS 1
+
 // Do we have a gettimeofday() function?
 #define HAVE_GETTIMEOFDAY
 

+ 4 - 0
dtool/LocalSetup.pp

@@ -25,6 +25,10 @@ $[cdefine HAVE_NAMESPACE]
 /* Define if the C++ iostream library supports ios::binary.  */
 $[cdefine HAVE_IOS_BINARY]
 
+/* Define if we can trust the compiler not to insert extra bytes in
+   structs between base structs and derived structs. */
+$[cdefine SIMPLE_STRUCT_POINTERS]
+
 /* Define if we have Dinkumware STL installed.  */
 $[cdefine HAVE_DINKUM]