--- a/AbstractOperatingSystem.st Tue May 17 00:56:14 2016 +0200
+++ b/AbstractOperatingSystem.st Tue May 17 02:04:25 2016 +0200
@@ -1939,27 +1939,27 @@
Return true if successful, false otherwise."
^ self
- executeCommand:aCommandString
- inputFrom:nil
- outputTo:anOutStreamOrNil
- errorTo:anErrStreamOrNil
- auxFrom:nil
- environment:nil
- inDirectory:nil
- lineWise:false
- onError:[:status| false]
+ executeCommand:aCommandString
+ inputFrom:nil
+ outputTo:anOutStreamOrNil
+ errorTo:anErrStreamOrNil
+ auxFrom:nil
+ environment:nil
+ inDirectory:nil
+ lineWise:false
+ onError:[:status| false]
"
String streamContents:[:s|OperatingSystem
- executeCommand:'ls'
- outputTo:s
+ executeCommand:'ls'
+ outputTo:s
]
"
"
String streamContents:[:s|OperatingSystem
- executeCommand:'pwd'
- outputTo:s
+ executeCommand:'pwd'
+ outputTo:s
]
"
!
@@ -3664,7 +3664,7 @@
%{ /* NOCONTEXT */
#ifndef CC_DEFINE
-# ifdef WIN32
+# ifdef __win32__
# if defined( __BORLANDC__ )
# define CC_DEFINE "__BORLANDC__"
# else
@@ -3682,9 +3682,9 @@
# endif
# endif
# endif
-# else /* not WIN32 */
-# ifdef __clang__
-# define CC_DEFINE "__clang__"
+# else /* not __win32__ */
+# ifdef __CLANG__
+# define CC_DEFINE "__CLANG__"
# else
# ifdef __GNUC__
# define CC_DEFINE "__GNUC__"
@@ -3736,7 +3736,9 @@
# ifdef __mips__
# define CPU_SYMBOL @symbol(mips)
# endif
-# ifdef __i386__
+# if defined(__x86__)
+# define CPU_SYMBOL @symbol(x86)
+# elif defined(__i386__) // old style
# define CPU_SYMBOL @symbol(i386)
# endif
# ifdef __x86_64__
@@ -3942,8 +3944,8 @@
%{ /* NOCONTEXT */
#ifndef OS_DEFINE
-# ifdef WIN32
-# define OS_DEFINE "-DWIN32"
+# ifdef __win32__
+# define OS_DEFINE "-D__win32__"
# endif
# ifndef OS_DEFINE
@@ -3969,19 +3971,33 @@
%{ /* NOCONTEXT */
-# ifdef MSDOS
-# define OS_SYMBOL @symbol(msdos)
-# endif
-
-# ifdef WIN32
+ // do not do this; all win sytems are counted as win32 (for now);
+ // see the detailed getSystemType / getSytemInfo for that
+ // # ifdef __win64__
+ // # define OS_SYMBOL @symbol(win64)
+ // # endif
+
+# ifdef __win32__
# define OS_SYMBOL @symbol(win32)
# endif
-# ifdef MSWINDOWS
+# ifdef __MSWINDOWS__
# define OS_SYMBOL @symbol(mswindows)
# endif
-# ifdef VMS
+# ifdef __OS2__
+# define OS_SYMBOL @symbol(os2)
+# endif
+
+# ifdef __BEOS__
+# define OS_SYMBOL @symbol(beos)
+# endif
+
+# ifdef __MSDOS__
+# define OS_SYMBOL @symbol(msdos)
+# endif
+
+# ifdef __VMS__
# ifdef __openVMS__
# define OS_SYMBOL @symbol(openVMS)
# else
@@ -3989,55 +4005,51 @@
# endif
# endif
-# ifdef MVS /* ;-) */
+# ifdef __MVS__ /* ;-) */
# define OS_SYMBOL @symbol(mvs)
# endif
-# ifdef OS2
-# define OS_SYMBOL @symbol(os2)
-# endif
-
-# ifdef sinix
+# ifdef __sinix__
# define OS_SYMBOL @symbol(sinix)
# endif
-# ifdef ultrix
+# ifdef __ultrix__
# define OS_SYMBOL @symbol(ultrix)
# endif
-# ifdef sco
+# ifdef __sco__
# define OS_SYMBOL @symbol(sco)
# endif
-# ifdef hpux
+# ifdef __hpux__
# define OS_SYMBOL @symbol(hpux)
# endif
-# ifdef LINUX
+# ifdef __linux__
# define OS_SYMBOL @symbol(linux)
# endif
-# ifdef FREEBSD
+# ifdef __FREEBSD__
# define OS_SYMBOL @symbol(freeBSD)
# endif
-# ifdef sunos
+# ifdef __sunos__
# define OS_SYMBOL @symbol(sunos)
# endif
-# ifdef solaris
+# ifdef __solaris__
# define OS_SYMBOL @symbol(solaris)
# endif
-# ifdef IRIS
+# ifdef __IRIS__
# define OS_SYMBOL @symbol(irix)
# endif
-# ifdef aix
+# ifdef __aix__
# define OS_SYMBOL @symbol(aix)
# endif
-# ifdef realIX
+# ifdef __realIX__
# define OS_SYMBOL @symbol(realIX)
# endif
@@ -4059,15 +4071,15 @@
# endif
# ifndef OS_SYMBOL
-# ifdef BSD
+# ifdef __BSD__
# define OS_SYMBOL @symbol(bsd)
# endif
-# ifdef SYSV
-# ifdef SYSV3
+# ifdef __SYSV__
+# ifdef __SYSV3__
# define OS_SYMBOL @symbol(sys5_3)
# else
-# ifdef SYSV4
+# ifdef __SYSV4__
# define OS_SYMBOL @symbol(sys5_4)
# else
# define OS_SYMBOL @symbol(sys5)
@@ -4080,13 +4092,13 @@
* become very vague ...
*/
# ifndef OS_SYMBOL
-# ifdef POSIX
-# define OS_SYMBOL @symbol(posix)
+# ifdef __UNIX__
+# define OS_SYMBOL @symbol(unix)
# endif
# endif
# ifndef OS_SYMBOL
-# ifdef UNIX
-# define OS_SYMBOL @symbol(unix)
+# ifdef __POSIX__
+# define OS_SYMBOL @symbol(posix)
# endif
# endif
@@ -4113,29 +4125,34 @@
%{ /* NOCONTEXT */
#ifndef PLATFORM_DEFINE
-# ifdef WIN32
-# define PLATFORM_DEFINE "-DWIN32"
+# ifdef __win32__
+# define PLATFORM_DEFINE "-D__win32__"
# endif
-# ifdef OS2
-# define PLATFORM_DEFINE "-DOS2"
+# ifdef __OS2__
+# define PLATFORM_DEFINE "-D__OS2__"
# endif
-# ifdef BEOS
-# define PLATFORM_DEFINE "-DBEOS"
+# ifdef __BEOS__
+# define PLATFORM_DEFINE "-D__BEOS__"
# endif
-# ifdef MACOS
-# define PLATFORM_DEFINE "-DMACOS"
+# ifdef __MACOS__
+# define PLATFORM_DEFINE "-D__MACOS__"
# endif
-# ifdef VMS
-# define PLATFORM_DEFINE "-DVMS"
+# ifdef __VMS__
+# define PLATFORM_DEFINE "-D__VMS__"
# endif
# ifdef __osx__
# define PLATFORM_DEFINE "-D__osx__"
# endif
-# ifdef OSX
-# define PLATFORM_DEFINE "-DOSX"
+// # ifdef OSX
+// # define PLATFORM_DEFINE "-DOSX"
+// # endif
+# ifndef PLATFORM_DEFINE
+# ifdef __UNIX__
+# define PLATFORM_DEFINE "-D__UNIX__"
+# endif
# endif
# ifndef PLATFORM_DEFINE
-# define PLATFORM_DEFINE "-DUNIX"
+# define PLATFORM_DEFINE "-DunknownPlatform"
# endif
#endif
@@ -4338,12 +4355,14 @@
^#(
win32
+ osx "/ yes!! it is supported
+ unix
+
os2 "/ actually - this is no longer true (OS/2 not supported)
macos "/ actually - this is no longer true (old MACOS not supported)
- vms "/ actually - this is no longer true (VMS not supported)
+ vms "/ actually - this is no longer true (VMS no longer supported)
+ qnx "/ actually - this is no longer true (qny no longer supported)
beos "/ actually - this was never true (beos not supported)
- osx "/ yes!! it is supported
- unix
)
"
@@ -4409,13 +4428,13 @@
platformDefineForPlatformName:osID
"return a c-define for a particular platform (use only for makefile generation etc.)"
- osID = #win32 ifTrue:[ ^ '-DWIN32'].
- osID = #os2 ifTrue:[ ^ '-DOS2'].
- osID = #macos ifTrue:[ ^ '-DMACOS'].
- osID = #beos ifTrue:[ ^ '-DBEOS'].
- osID = #vms ifTrue:[ ^ '-DVMS'].
- osID = #unix ifTrue:[ ^ '-DUNIX'].
- osID = #osx ifTrue:[ ^ '-DOSX'].
+ osID = #win32 ifTrue:[ ^ '-D__win32__'].
+ osID = #os2 ifTrue:[ ^ '-D__OS2__'].
+ osID = #macos ifTrue:[ ^ '-D__MACOS__'].
+ osID = #beos ifTrue:[ ^ '-D__beos__'].
+ osID = #vms ifTrue:[ ^ '-D__VMS__'].
+ osID = #unix ifTrue:[ ^ '-D__UNIX__'].
+ osID = #osx ifTrue:[ ^ '-D__OSX__'].
self error:'unknown os'.
"
@@ -4433,10 +4452,12 @@
|os|
os := self getSystemType.
+ os = #osx ifTrue:[ ^ #osx].
os = #win32 ifTrue:[ ^ #win32].
+
os = #os2 ifTrue:[ ^ #os2].
- os = #osx ifTrue:[ ^ #osx].
os = #macos ifTrue:[ ^ #macos].
+
os = #VMS ifTrue:[ ^ #vms].
os = #openVMS ifTrue:[ ^ #vms].
^ #unix