[AD] Allegro and OpenWatcom

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


Glenn Jarvis recently emailed me privately to let me know that version 0.85+ 
of the OpenWatcom compiler can now link correctly Allegro programs. It is 
able to flawlessly build Allegro 4.0.2, but not Allegro 4.1.7 because of a 
wrong command line passed to the linker.

The problem is now fixed in the CVS tree (see my answer to Sven's announcement 
for Adime 2.0.0 on [AL]) but there is one last nit: there are several warnings 
due to 'const'-correctness issues. The Watcom port so far defines AL_CONST as 
doing nothing: does anyone know why ? Does version 11 not support the 'const' 
keyword ? Or version 10.6 ?

The attached patch silences all the warnings by defining AL_CONST for Watcom C 
version 11 or later.

-- 
Eric Botcazou
--- /cvs/allegro/include/allegro/platform/alwatcom.h	Sat Nov  2 19:34:10 2002
+++ allegro/include/allegro/platform/alwatcom.h	Fri Dec 13 17:14:00 2002
@@ -47,6 +47,7 @@
 #define ALLEGRO_LFN  0
 
 #if __WATCOMC__ >= 1100
+   #define AL_CONST     const
    #define ALLEGRO_MMX
 #endif
 
--- /cvs/allegro/src/misc/modex.c	Wed Oct  2 20:27:40 2002
+++ allegro/src/misc/modex.c	Fri Dec 13 17:21:50 2002
@@ -1149,7 +1149,7 @@
  */
 void _x_draw_rle_sprite(BITMAP *bmp, AL_CONST RLE_SPRITE *sprite, int x, int y)
 {
-   signed char *p = sprite->dat;
+   AL_CONST signed char *p = sprite->dat;
    int c;
    int x_pos, y_pos;
    int lgap, width;
@@ -1253,7 +1253,7 @@
  */
 void _x_draw_trans_rle_sprite(BITMAP *bmp, AL_CONST RLE_SPRITE *sprite, int x, int y)
 {
-   signed char *p = sprite->dat;
+   AL_CONST signed char *p = sprite->dat;
    int c;
    int x_pos, y_pos;
    int lgap, width;
@@ -1359,7 +1359,7 @@
  */
 void _x_draw_lit_rle_sprite(BITMAP *bmp, AL_CONST RLE_SPRITE *sprite, int x, int y, int color)
 {
-   signed char *p = sprite->dat;
+   AL_CONST signed char *p = sprite->dat;
    int c;
    int x_pos, y_pos;
    int lgap, width;
@@ -1486,8 +1486,8 @@
  */
 void _x_draw_glyph(BITMAP *bmp, AL_CONST FONT_GLYPH *glyph, int x, int y, int color, int bg)
 {
-   unsigned char *data = glyph->dat;
-   unsigned char *dat;
+   AL_CONST unsigned char *data = glyph->dat;
+   AL_CONST unsigned char *dat;
    unsigned long addr;
    int w = glyph->w;
    int h = glyph->h;
--- /home/eric/cvs/allegro/docs/build/watcom.txt	Fri Jul  5 12:23:46 2002
+++ allegro/docs/build/watcom.txt	Fri Dec 13 18:08:51 2002
@@ -27,8 +27,8 @@
    respect.
 
    This library works with version 10.6 and the various 11.0 versions of the
-   Watcom C compiler, except the latest one (11.0c) which can build the
-   library but cannot link Allegro programs.
+   Watcom C compiler (except the original 11.0c version) as well as with
+   recent versions (0.85 or later) of the OpenWatcom C compiler.
 
 
 
@@ -36,7 +36,7 @@
 ============ Required software ============
 ===========================================
 
-   - Watcom C, version 10.6 or 11.0 (but not 11.0c).
+   - Watcom C version 10.6 or 11.0, or OpenWatcom C version 0.85 or later.
    - djgpp compiler (djdev*.zip, gcc*b.zip, and bnu*b.zip).
    - GNU make (mak*b.zip).
    - GNU sed (sed*b.zip):


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