From: <mee...@us...> - 2006-02-23 22:21:13
|
Update of /cvsroot/sc2/tools/map In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18195 Modified Files: Makefile port.h sdlpngdrv.c Added Files: port.c Log Message: Compatibility improvements. --- NEW FILE: port.c --- #include "port.h" #ifndef HAVE_STRUPR #include <ctype.h> char * strupr (char *str) { char *ptr; ptr = str; while (*ptr) { *ptr = (char) toupper (*ptr); ptr++; } return str; } #endif Index: Makefile =================================================================== RCS file: /cvsroot/sc2/tools/map/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 23 Feb 2006 21:40:07 -0000 1.1 --- Makefile 23 Feb 2006 22:21:01 -0000 1.2 *************** *** 8,23 **** TARGET = mapgen # These flags are needed to get it to compile with libpngX.dll on CYGWIN ! CYGWINFLAGS = -DPNG_USE_DLL ! #CYGWINFLAGS = PNGFLAGS = -I. SDLFLAGS = $(shell sdl-config --cflags) CC = gcc ! CFLAGS = -W -Wall -O0 # -g LIBS = -L/usr/local/lib -lpng -lm -lSDL_ttf -lSDL_image ! LDFLAGS = $(shell sdl-config --libs) BINS = $(TARGET) $(TARGET).exe ! OBJS = mapgen.o alist.o scriptlib.o stringbank.o unicode.o sdlpngdrv.o SDL_gfxPrimitives.o .SUFFIXES: .c .o --- 8,23 ---- TARGET = mapgen # These flags are needed to get it to compile with libpngX.dll on CYGWIN ! #CYGWINFLAGS = -DPNG_USE_DLL ! CYGWINFLAGS = PNGFLAGS = -I. SDLFLAGS = $(shell sdl-config --cflags) CC = gcc ! CFLAGS += -W -Wall -O0 # -g LIBS = -L/usr/local/lib -lpng -lm -lSDL_ttf -lSDL_image ! LDFLAGS += $(shell sdl-config --libs) BINS = $(TARGET) $(TARGET).exe ! OBJS = mapgen.o alist.o scriptlib.o stringbank.o unicode.o sdlpngdrv.o SDL_gfxPrimitives.o port.o .SUFFIXES: .c .o Index: port.h =================================================================== RCS file: /cvsroot/sc2/tools/map/port.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** port.h 23 Feb 2006 21:40:07 -0000 1.1 --- port.h 23 Feb 2006 22:21:01 -0000 1.2 *************** *** 15,18 **** --- 15,30 ---- #define countof(a) ( sizeof(a)/sizeof(*a) ) + #ifdef __WIN32__ + # define HAVE_STRICMP + # define HAVE_STRUPR + #endif + + + #ifndef HAVE_STRICMP + # define stricmp strcasecmp + #else + # define strcasecmp stricmp + #endif + #endif /* _PORT_H */ Index: sdlpngdrv.c =================================================================== RCS file: /cvsroot/sc2/tools/map/sdlpngdrv.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sdlpngdrv.c 23 Feb 2006 21:40:07 -0000 1.1 --- sdlpngdrv.c 23 Feb 2006 22:21:01 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- #include <stdio.h> #include <malloc.h> + #include <string.h> #include <errno.h> #include "SDL.h" |