[AD] 4.3.1 msvc 6 patches

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


Attached are three patches to fix Allegro 4.3.1 for MSVC6.

1) events.c.diff:

Changes long long to LONG_LONG

2) msvcfunc.diff:

MSVC 6 does not have a __FUNCTION__ macro. The patch conditionally
sets __func__ to either __FUNCTION__ or "???"

3) wkeybdnu.c.diff:

Changes the LL suffix to a (LONG_LONG) cast.

It might be useful instead to create a macro like LL(number) that
would look like one of:

#define LL(a) (a##LL)

#define LL(a) ((LONG_LONG) a)

depending on the platform's support. Obviously it'd only be intended
for numeric literals.

--
Matthew Leverton
--- allegro-4.3.1\src\events.c	2007-04-21 13:54:32.000000000 -0500
+++ allegro-4.3.1-dev\src\events.c	2007-05-03 18:17:01.784723200 -0500
@@ -437,7 +437,7 @@
    else {
       /* XXX: Should get rid of long longs at some stage. */
       /* XXX: Watch out for al_current_time(), which could wrap. */
-      long long end, remaining;
+      LONG_LONG end, remaining;
 
       end = al_current_time() + msecs;
 
--- allegro-4.3.1\include\allegro\platform\almsvc.h	2007-04-21 13:54:40.000000000 -0500
+++ allegro-4.3.1-dev\include\allegro\platform\almsvc.h	2007-05-03 18:21:42.805945600 -0500
@@ -83,7 +83,11 @@
 
 /* __func__ is C99 */
 #ifndef __func__
-   #define __func__  __FUNCTION__
+   #if _MSVC_VER < 1300
+      #define __func__ "???"
+   #else
+      #define __func__  __FUNCTION__
+   #endif
 #endif
 
 
--- allegro-4.3.1\src\win\wkeybdnu.c	2007-04-21 13:54:34.000000000 -0500
+++ allegro-4.3.1-dev\src\win\wkeybdnu.c	2007-05-03 18:35:44.361809600 -0500
@@ -355,7 +355,7 @@
 
    /* units are 100e-9 seconds; negative means relative time */
    /* 0 ==> 0.25 seconds, 3 ==> 1.0 second */
-   repeat_delay.QuadPart = -10000000LL * (delay+1)/4;
+   repeat_delay.QuadPart = (LONG_LONG) -10000000 * (delay+1)/4;
 
    /* units are milliseconds */
    /* 0 ==> 2.5 repetitions/sec, 31 ==> 31 repetitions/sec */


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