test/testver.c
author Ryan C. Gordon <icculus@icculus.org>
Sun, 11 Jan 2009 04:05:28 +0000
changeset 3017 3272431eeee2
parent 2983 388c5a2daeac
child 4419 5e7e1f1a4056
permissions -rw-r--r--
Added testresample.c
slouken@0
     1
slouken@0
     2
/* Test program to compare the compile-time version of SDL with the linked
slouken@0
     3
   version of SDL
slouken@0
     4
*/
slouken@0
     5
slouken@0
     6
#include <stdio.h>
icculus@1154
     7
#include <stdlib.h>
slouken@0
     8
slouken@0
     9
#include "SDL.h"
slouken@0
    10
slouken@1895
    11
int
slouken@1895
    12
main(int argc, char *argv[])
slouken@0
    13
{
slouken@1895
    14
    SDL_version compiled;
slouken@2983
    15
    SDL_version linked;
slouken@0
    16
slouken@2983
    17
#if SDL_VERSION_ATLEAST(1, 3, 0)
slouken@2983
    18
    printf("Compiled with SDL 1.3 or newer\n");
slouken@0
    19
#else
slouken@2983
    20
    printf("Compiled with SDL older than 1.3\n");
slouken@0
    21
#endif
slouken@1895
    22
    SDL_VERSION(&compiled);
slouken@2983
    23
    printf("Compiled version: %d.%d.%d-%d\n",
slouken@2983
    24
           compiled.major, compiled.minor, compiled.patch, SDL_REVISION);
slouken@2983
    25
    SDL_GetVersion(&linked);
slouken@2983
    26
    printf("Linked version: %d.%d.%d-%d\n",
slouken@2983
    27
           linked.major, linked.minor, linked.patch, SDL_GetRevision());
slouken@1895
    28
    SDL_Quit();
slouken@1895
    29
    return (0);
slouken@0
    30
}