Re: [AD] Proposing patch in windows detection

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


--- Peter Wang <tjaden@xxxxxxxxxx> wrote:

> But why do we need such fine-grained Win* detection, or any OS
> detection
> at all?  I understand that the djgpp port behaves differently when
> running under Windows, but that's about it.
> 
> Peter

If we don't need, so why it is still there? I've proposed a very simple
and small patch (some messages ago), to fix that. It's not that so
fine-grained detection, and i believe it's not harmful to anyone. It's
more just a update (detects Windows 2003 and Longhorn).

The discussion is exactly that: Should it be that so fine or not? But
if you say that it shouldn't, so that is! (actually it isn't)

I'd reattached it here, for convenience. It's a bit different to the
preview one though (lets say Vista==Longhorn for simplicity).

Victor Williams Stafusa da Silva


	



	
		
_______________________________________________________ 
Faça do Yahoo! sua página inicial. 
http://br.yahoo.com/homepageset.html 
diff -u3 Al4.2.0/system.h proposed/system.h
--- Al4.2.0/system.h	Tue Mar 15 20:32:44 2005
+++ proposed/system.h	Thu Nov 24 05:23:30 2005
@@ -45,6 +45,8 @@
 #define OSTYPE_WINNT       AL_ID('W','N','T',' ')
 #define OSTYPE_WIN2000     AL_ID('W','2','K',' ')
 #define OSTYPE_WINXP       AL_ID('W','X','P',' ')
+#define OSTYPE_WIN2003     AL_ID('W','2','K','3')
+#define OSTYPE_WINLONGHORN AL_ID('W','L','H',' ')
 #define OSTYPE_OS2         AL_ID('O','S','2',' ')
 #define OSTYPE_WARP        AL_ID('W','A','R','P')
 #define OSTYPE_DOSEMU      AL_ID('D','E','M','U')
diff -u3 Al4.2.0/wsystem.c proposed/wsystem.c
--- Al4.2.0/wsystem.c	Mon Aug 22 21:37:18 2005
+++ proposed/wsystem.c	Thu Nov 24 06:13:39 2005
@@ -142,8 +142,18 @@
    os_multitasking = TRUE;
 
    if (win_ver < 0x80000000) {
-      if (os_version == 5) {
-         if(os_revision == 1)
+
+      /* Since doesn't exist os_version == 7 or greater yet,
+         these will be detected as Longhorn instead of NT. */
+      if (os_version >= 6) {
+         os_type = OSTYPE_WINLONGHORN;
+      }
+      else if (os_version == 5) {
+         /* If in the future a os_revision == 3 or greater comes,
+            it will be detected as Win2003 instead of Win2000. */
+         if (os_revision >= 2)
+	    os_type = OSTYPE_WIN2003;
+         else if (os_revision == 1)
 	    os_type = OSTYPE_WINXP;
 	 else
 	    os_type = OSTYPE_WIN2000;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/