]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Fixed a few compile things
[wxWidgets.git] / include / wx / defs.h
index 456eb162ed2695bf835428c0160785a512887fa2..b4fb9a7b2964278a0b074b0723c72e8a69f8c361 100644 (file)
 #include "wx/version.h"
 
 // Helps SGI compilation, apparently
-#if defined(__SGI__) && defined(__GNUG__)
+#if defined(__SGI__) 
+#if defined(__GNUG__)
 #define __need_wchar_t
+#else
+/* Note I use the term __SGI_CC__ for both cc and CC, its not a good idea to 
+ * mix gcc and cc/CC, the name mangling is different */
+#define __SGI_CC__
+#endif
 #endif
 
 // Eliminate double/float warnings
@@ -169,22 +175,9 @@ typedef int wxWindowID;
 class WXDLLEXPORT wxObject;
 class WXDLLEXPORT wxEvent;
 
-// Vadim's types - check whether we need them all
-
-/// the type for various indexes (string, arrays, ...)
-typedef unsigned int    uint;
-
-/// extended boolean type: { yes, no, may be }
-typedef signed   int    EBool;
-
-/// with TRUE and FALSE is a possible value for a "3-state" boolean var
-#define UNKNOWN         (-1)
-  /** symbolic constant used by all Find()-like functions returning positive
+ /** symbolic constant used by all Find()-like functions returning positive
       integer on success as failure indicator */
 #define NOT_FOUND       (-1)
-  /** useful for Windows programmers: makes somewhat more clear all these 
-      zeroes being passed to Windows APIs */
-#define RESERVED        (NULL)
 
 // ----------------------------------------------------------------------------
 // Error codes
@@ -212,10 +205,27 @@ enum  ErrCode
 //  a question of style, because delete will do it itself anyhow, but it might
 //  be considered as an error by some overzealous debugging implementations of
 //  the library, so we do it ourselves)
-#define wxDELETE(p)      if ( (p) != NULL ) { delete (p); p = NULL; }
+#if defined(__SGI_CC__)
+// Okay this is bad styling, but the native SGI compiler is very picky, it 
+// wont let you compare/assign between a NULL (void *) and another pointer
+// type. To be really clean we'd need to pass in another argument, the type 
+// of p. 
+// Also note the use of 0L, this would allow future possible 64bit support 
+// (as yet untested) by ensuring that we zero all the bits in a pointer 
+// (which is always the same length as a long (at least with the LP64 standard) 
+// --- offer aug 98
+#define wxDELETE(p)      if ( (p) ) { delete (p); p = 0L; }
+#else
+#define wxDELETE(p)      if ( (p) != NULL ) { delete p; p = NULL; }
+#endif /* __SGI__CC__ */
 
 // delete an array and NULL it (see comments above)
-#define wxDELETEA(p)      if ( (p) != NULL ) { delete [] (p); p = NULL; }
+#if defined(__SGI_CC__)
+// see above comment.
+#define wxDELETEA(p)      if ( (p) ) { delete [] (p); p = 0L; }
+#else
+#define wxDELETEA(p)      if ( ((void *) (p)) != NULL ) { delete [] p; p = NULL; }
+#endif /* __SGI__CC__ */
 
 /// size of statically declared array
 #define WXSIZEOF(array)   (sizeof(array)/sizeof(array[0]))
@@ -225,7 +235,7 @@ enum  ErrCode
 // ----------------------------------------------------------------------------
 
 // OS
-#if     defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__)
+#if     defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi )
   #ifndef __UNIX__
     #define __UNIX__
   #endif
@@ -244,14 +254,6 @@ enum  ErrCode
 
 #endif  // OS
 
-#if     defined(__UNIX__)
-  #define FILE_PATH_SEPARATOR   ('/')
-#elif   defined(__WXMSW__)
-  #define FILE_PATH_SEPARATOR   ('\\')
-#else
-  #define FILE_PATH_SEPARATOR   ('/')
-#endif
-
 // ----------------------------------------------------------------------------
 // compiler specific settings
 // ----------------------------------------------------------------------------
@@ -865,6 +867,7 @@ typedef unsigned long   WXCOLORREF;
 typedef void *          WXRGNDATA;
 typedef void *          WXMSG;
 typedef unsigned long   WXHCONV;
+typedef unsigned long   WXHKEY;
 typedef void *          WXDRAWITEMSTRUCT;
 typedef void *          WXMEASUREITEMSTRUCT;
 typedef void *          WXLPCREATESTRUCT;