test/testver.c
author Ryan C. Gordon <icculus@icculus.org>
Sun, 28 Feb 2010 02:07:40 -0500
changeset 4419 5e7e1f1a4056
parent 2983 388c5a2daeac
child 5310 a9945ce48999
permissions -rw-r--r--
Changed revision details to be a string (an hg changeset) instead of an int.
     1 
     2 /* Test program to compare the compile-time version of SDL with the linked
     3    version of SDL
     4 */
     5 
     6 #include <stdio.h>
     7 #include <stdlib.h>
     8 
     9 #include "SDL.h"
    10 
    11 int
    12 main(int argc, char *argv[])
    13 {
    14     SDL_version compiled;
    15     SDL_version linked;
    16 
    17 #if SDL_VERSION_ATLEAST(1, 3, 0)
    18     printf("Compiled with SDL 1.3 or newer\n");
    19 #else
    20     printf("Compiled with SDL older than 1.3\n");
    21 #endif
    22     SDL_VERSION(&compiled);
    23     printf("Compiled version: %d.%d.%d (%s)\n",
    24            compiled.major, compiled.minor, compiled.patch, SDL_REVISION);
    25     SDL_GetVersion(&linked);
    26     printf("Linked version: %d.%d.%d (%s)\n",
    27            linked.major, linked.minor, linked.patch, SDL_GetRevision());
    28     SDL_Quit();
    29     return (0);
    30 }