test/testver.c
author Sam Lantinga <slouken@libsdl.org>
Wed, 19 Jan 2011 22:20:44 -0800
changeset 5046 4cb778067834
parent 4419 5e7e1f1a4056
child 5310 a9945ce48999
permissions -rw-r--r--
Clearing the API changes for the 1.3.0 release
     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 }