AbstractOperatingSystem.st
changeset 9698 e8e27fbaa232
parent 9697 d079abe6b6e6
child 9699 9e706dd0ccc8
--- a/AbstractOperatingSystem.st	Thu Aug 24 12:20:00 2006 +0200
+++ b/AbstractOperatingSystem.st	Thu Aug 24 12:23:56 2006 +0200
@@ -3475,6 +3475,35 @@
     "
 !
 
+getPlatformDefine
+    "return a string which defines the platform,
+     and which should be passed down when compiling methods.
+     For example, on all unices, this is '-DUNIX'."
+
+%{  /* NOCONTEXT */
+
+#ifndef PLATFORM_DEFINE
+# ifdef WIN32
+#  define PLATFORM_DEFINE "-DWIN32"
+# endif
+# ifdef OS2
+#  define PLATFORM_DEFINE "-DOS2"
+# endif
+# ifdef BEOS
+#  define PLATFORM_DEFINE "-DBEOS"
+# endif
+# ifndef PLATFORM_DEFINE
+#  define PLATFORM_DEFINE "-DUNIX"
+# endif
+#endif
+
+    RETURN ( __MKSTRING(PLATFORM_DEFINE));
+%}
+    "
+     OperatingSystem getPlatformDefine
+    "
+!
+
 getProcessId
     "return the (unix-)processId"
 
@@ -3657,6 +3686,7 @@
     "
      OperatingSystem knownPlatformNames
      OperatingSystem platformName
+     OperatingSystem getPlatformDefine
     "
 
     "Modified: 20.6.1997 / 17:37:26 / cg"
@@ -6361,7 +6391,7 @@
 !AbstractOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.153 2006-08-24 10:20:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/AbstractOperatingSystem.st,v 1.154 2006-08-24 10:23:56 cg Exp $'
 ! !
 
 AbstractOperatingSystem initialize!