test/testver.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 08 Apr 2011 13:03:26 -0700
changeset 5535 96594ac5fd1a
parent 5359 d5fe4ed3a28d
child 6251 3e8c673cad58
permissions -rw-r--r--
SDL 1.3 is now under the zlib license.
slouken@5535
     1
/*
slouken@5535
     2
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
slouken@5535
     3
slouken@5535
     4
  This software is provided 'as-is', without any express or implied
slouken@5535
     5
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     6
  arising from the use of this software.
slouken@5535
     7
slouken@5535
     8
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
     9
  including commercial applications, and to alter it and redistribute it
slouken@5535
    10
  freely.
slouken@5535
    11
*/
slouken@0
    12
slouken@0
    13
/* Test program to compare the compile-time version of SDL with the linked
slouken@0
    14
   version of SDL
slouken@0
    15
*/
slouken@0
    16
slouken@0
    17
#include <stdio.h>
icculus@1154
    18
#include <stdlib.h>
slouken@0
    19
slouken@0
    20
#include "SDL.h"
slouken@5310
    21
#include "SDL_revision.h"
slouken@0
    22
slouken@1895
    23
int
slouken@1895
    24
main(int argc, char *argv[])
slouken@0
    25
{
slouken@1895
    26
    SDL_version compiled;
slouken@2983
    27
    SDL_version linked;
slouken@0
    28
slouken@2983
    29
#if SDL_VERSION_ATLEAST(1, 3, 0)
slouken@2983
    30
    printf("Compiled with SDL 1.3 or newer\n");
slouken@0
    31
#else
slouken@2983
    32
    printf("Compiled with SDL older than 1.3\n");
slouken@0
    33
#endif
slouken@1895
    34
    SDL_VERSION(&compiled);
slouken@5359
    35
    printf("Compiled version: %d.%d.%d.%d (%s)\n",
slouken@5359
    36
           compiled.major, compiled.minor, compiled.patch,
slouken@5359
    37
           SDL_REVISION_NUMBER, SDL_REVISION);
slouken@2983
    38
    SDL_GetVersion(&linked);
slouken@5359
    39
    printf("Linked version: %d.%d.%d.%d (%s)\n",
slouken@5359
    40
           linked.major, linked.minor, linked.patch,
slouken@5359
    41
           SDL_GetRevisionNumber(), SDL_GetRevision());
slouken@1895
    42
    SDL_Quit();
slouken@1895
    43
    return (0);
slouken@0
    44
}