Commits

Daniel Green committed ae5139f

Set version MinGW32, MinGW64 and MinGW when approriate.
Make -m32 define Win32 and not Win64.
Win64 now correctly defines TARET_WINDOS.

Comments (0)

Files changed (2)

     if (cpu_versym)
         VersionCondition::addPredefinedGlobalIdent(cpu_versym);
 #ifdef D_OS_VERSYM
-    VersionCondition::addPredefinedGlobalIdent(D_OS_VERSYM);
+    if (strcmp(D_OS_VERSYM, "Win64") == 0 && !TARGET_64BIT)
+    {
+        // -m32 should set up for Win32.
+        VersionCondition::addPredefinedGlobalIdent("Win32");
+        is_target_win32 = true;
+    }
+    else
+        VersionCondition::addPredefinedGlobalIdent(D_OS_VERSYM);
+
     if (strcmp(D_OS_VERSYM, "darwin") == 0)
         VersionCondition::addPredefinedGlobalIdent("OSX");
     if (strcmp(D_OS_VERSYM, "Win32") == 0)
 #endif
 #ifdef D_OS_VERSYM2
     VersionCondition::addPredefinedGlobalIdent(D_OS_VERSYM2);
+    
+    if (strncmp(D_OS_VERSYM2, "MinGW", 5) == 0)
+    {
+        // Should MinGW exist? Rationale:  Windows, Win32 and Win64.
+        VersionCondition::addPredefinedGlobalIdent("MinGW");
+    }
     if (strcmp(D_OS_VERSYM2, "Win32") == 0)
         is_target_win32 = true;
 #endif

d/target-ver-syms.sh

 kopensolaris*-gnu) d_os_versym=Solaris; d_unix=1 ;;
 linux*) d_os_versym=linux ; d_unix=1 ;; # This is supposed to be "linux", not "Linux", according to the spec
 mingw32*) case "$target_vendor" in
-              pc*) d_os_versym=Win32; d_os_versym2=MinGW; d_windows=1 ;;
-              w64*) d_os_versym=Win64; d_os_versym2=MinGW; d_windows=1 ;;
+              pc*) d_os_versym=Win32; d_os_versym2=MinGW32; d_windows=1 ;;
+              w64*) d_os_versym=Win64; d_os_versym2=MinGW64; d_windows=1 ;;
           esac
           ;;
 openbsd*) d_os_versym=OpenBSD; d_unix=1 ;;
 OpenBSD) echo "#define TARGET_OPENBSD 1" ;;
 Solaris) echo "#define TARGET_SOLARIS 1" ;;
 Win32)   echo "#define TARGET_WINDOS  1" ;;
+Win64)   echo "#define TARGET_WINDOS  1" ;;
 *)       echo "#define TARGET_UNIX    1" ;;
 esac