From: <tr...@us...> - 2009-10-13 04:14:15
|
Revision: 12667 http://alleg.svn.sourceforge.net/alleg/?rev=12667&view=rev Author: trentg Date: 2009-10-13 04:14:04 +0000 (Tue, 13 Oct 2009) Log Message: ----------- Small changes to make it compile with MSVC Modified Paths: -------------- allegro/branches/4.9/addons/font/font.c allegro/branches/4.9/addons/image/jpg.c allegro/branches/4.9/examples/ex_config.c allegro/branches/4.9/examples/ex_dir.c allegro/branches/4.9/examples/ex_monitorinfo.c allegro/branches/4.9/examples/ex_user_events.c Modified: allegro/branches/4.9/addons/font/font.c =================================================================== --- allegro/branches/4.9/addons/font/font.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/addons/font/font.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -226,13 +226,13 @@ static int quick_color_render(const ALLEGRO_FONT *f, const ALLEGRO_USTR *text, int x0, int y) { +#define MAX_CHARS 100 /* MSVC can't tell that 'const int' is constant */ int pos = 0; int x = 0; int32_t ch; int i, j; int total = 0; int length = al_ustr_length(text); - const int MAX_CHARS = 100; ALLEGRO_VERTEX verts[6*MAX_CHARS]; while (total < length) { @@ -258,6 +258,7 @@ } return x - x0; +#undef MAX_CHARS } /* color_render: Modified: allegro/branches/4.9/addons/image/jpg.c =================================================================== --- allegro/branches/4.9/addons/image/jpg.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/addons/image/jpg.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -2,6 +2,18 @@ * by Elias Pschernig */ +/* + * The INT32 definition in jmorecfg.h interferes with some standard + * includes in MinGW versions prior to 4.4. Include standard header + * first. + */ +#if (defined __MINGW32__ && ( \ + __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))) +#include "allegro5/allegro5.h" +/* jmorecfg.h gets this wrong -- basetsd.h defines _BASETSD_H not _BASETSD_H_ */ +#define _BASETSD_H_ +#endif + #include <stdio.h> #include <stdlib.h> #include <setjmp.h> @@ -15,7 +27,12 @@ #define BUFFER_SIZE 4096 +/* If not MinGW < 4.4, include as normal */ +#if !(defined __MINGW32__ && ( \ + __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))) #include "allegro5/allegro5.h" +#endif + #include "allegro5/fshook.h" #include "allegro5/internal/aintern_memory.h" #include "allegro5/allegro_image.h" Modified: allegro/branches/4.9/examples/ex_config.c =================================================================== --- allegro/branches/4.9/examples/ex_config.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/examples/ex_config.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -5,6 +5,7 @@ */ #include <stdio.h> +#define ALLEGRO_USE_CONSOLE #include "allegro5/allegro5.h" #include "common.c" Modified: allegro/branches/4.9/examples/ex_dir.c =================================================================== --- allegro/branches/4.9/examples/ex_dir.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/examples/ex_dir.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -1,3 +1,4 @@ +#define ALLEGRO_USE_CONSOLE #include <allegro5/allegro5.h> #include <stdio.h> Modified: allegro/branches/4.9/examples/ex_monitorinfo.c =================================================================== --- allegro/branches/4.9/examples/ex_monitorinfo.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/examples/ex_monitorinfo.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -1,3 +1,4 @@ +#define ALLEGRO_USE_CONSOLE #include "allegro5/allegro5.h" #include <stdio.h> Modified: allegro/branches/4.9/examples/ex_user_events.c =================================================================== --- allegro/branches/4.9/examples/ex_user_events.c 2009-10-13 00:29:43 UTC (rev 12666) +++ allegro/branches/4.9/examples/ex_user_events.c 2009-10-13 04:14:04 UTC (rev 12667) @@ -3,6 +3,7 @@ */ #include <stdio.h> +#define ALLEGRO_USE_CONSOLE #include "allegro5/allegro5.h" #include "common.c" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |