Fine tuned revision code, updated testver
authorSam Lantinga <slouken@libsdl.org>
Sun, 04 Jan 2009 05:27:13 +0000
changeset 2983388c5a2daeac
parent 2982 b64c1d23039b
child 2984 0b160c970b7e
Fine tuned revision code, updated testver
Makefile.in
src/SDL.c
test/testver.c
     1.1 --- a/Makefile.in	Sun Jan 04 05:08:12 2009 +0000
     1.2 +++ b/Makefile.in	Sun Jan 04 05:27:13 2009 +0000
     1.3 @@ -35,6 +35,7 @@
     1.4  TARGET  = libSDL.la
     1.5  SOURCES = @SOURCES@
     1.6  OBJECTS = @OBJECTS@
     1.7 +REVISION = $(srcdir)/include/SDL_revision.h
     1.8  
     1.9  SDLMAIN_TARGET = libSDLmain.a
    1.10  SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
    1.11 @@ -66,6 +67,8 @@
    1.12  update-revision:
    1.13  	$(SHELL) $(auxdir)/updaterev.sh
    1.14  
    1.15 +$(REVISION): update-revision
    1.16 +
    1.17  .PHONY: all update-revision depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
    1.18  depend:
    1.19  	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \
    1.20 @@ -78,7 +81,7 @@
    1.21  
    1.22  include $(depend)
    1.23  
    1.24 -$(objects)/$(TARGET): update-revision $(OBJECTS)
    1.25 +$(objects)/$(TARGET): $(REVISION) $(OBJECTS)
    1.26  	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
    1.27  
    1.28  $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
     2.1 --- a/src/SDL.c	Sun Jan 04 05:08:12 2009 +0000
     2.2 +++ b/src/SDL.c	Sun Jan 04 05:27:13 2009 +0000
     2.3 @@ -300,7 +300,7 @@
     2.4  int
     2.5  SDL_GetRevision()
     2.6  {
     2.7 -    SDL_REVISION;
     2.8 +    return SDL_REVISION;
     2.9  }
    2.10  
    2.11  #if defined(__OS2__)
     3.1 --- a/test/testver.c	Sun Jan 04 05:08:12 2009 +0000
     3.2 +++ b/test/testver.c	Sun Jan 04 05:27:13 2009 +0000
     3.3 @@ -12,26 +12,19 @@
     3.4  main(int argc, char *argv[])
     3.5  {
     3.6      SDL_version compiled;
     3.7 +    SDL_version linked;
     3.8  
     3.9 -    /* Initialize SDL */
    3.10 -    if (SDL_Init(0) < 0) {
    3.11 -        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
    3.12 -        exit(1);
    3.13 -    }
    3.14 -#ifdef DEBUG
    3.15 -    fprintf(stderr, "SDL initialized\n");
    3.16 -#endif
    3.17 -#if SDL_VERSION_ATLEAST(1, 2, 0)
    3.18 -    printf("Compiled with SDL 1.2 or newer\n");
    3.19 +#if SDL_VERSION_ATLEAST(1, 3, 0)
    3.20 +    printf("Compiled with SDL 1.3 or newer\n");
    3.21  #else
    3.22 -    printf("Compiled with SDL older than 1.2\n");
    3.23 +    printf("Compiled with SDL older than 1.3\n");
    3.24  #endif
    3.25      SDL_VERSION(&compiled);
    3.26 -    printf("Compiled version: %d.%d.%d\n",
    3.27 -           compiled.major, compiled.minor, compiled.patch);
    3.28 -    printf("Linked version: %d.%d.%d\n",
    3.29 -           SDL_Linked_Version()->major,
    3.30 -           SDL_Linked_Version()->minor, SDL_Linked_Version()->patch);
    3.31 +    printf("Compiled version: %d.%d.%d-%d\n",
    3.32 +           compiled.major, compiled.minor, compiled.patch, SDL_REVISION);
    3.33 +    SDL_GetVersion(&linked);
    3.34 +    printf("Linked version: %d.%d.%d-%d\n",
    3.35 +           linked.major, linked.minor, linked.patch, SDL_GetRevision());
    3.36      SDL_Quit();
    3.37      return (0);
    3.38  }