include/SDL_version.h
changeset 1895 c121d94672cb
parent 1886 44635227a939
child 2859 99210400e8b9
     1.1 --- a/include/SDL_version.h	Thu Jul 06 18:01:37 2006 +0000
     1.2 +++ b/include/SDL_version.h	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -20,7 +20,11 @@
     1.4      slouken@libsdl.org
     1.5  */
     1.6  
     1.7 -/* This header defines the current SDL version */
     1.8 +/**
     1.9 + * \file SDL_version.h
    1.10 + *
    1.11 + * This header defines the current SDL version
    1.12 + */
    1.13  
    1.14  #ifndef _SDL_version_h
    1.15  #define _SDL_version_h
    1.16 @@ -30,29 +34,58 @@
    1.17  #include "begin_code.h"
    1.18  /* Set up for C function definitions, even when using C++ */
    1.19  #ifdef __cplusplus
    1.20 +/* *INDENT-OFF* */
    1.21  extern "C" {
    1.22 +/* *INDENT-ON* */
    1.23  #endif
    1.24  
    1.25 +/**
    1.26 + * \struct SDL_version
    1.27 + * \brief Information the version of SDL in use.
    1.28 + *
    1.29 + * Represents the library's version as three levels: major revision
    1.30 + *  (increments with massive changes, additions, and enhancements),
    1.31 + *  minor revision (increments with backwards-compatible changes to the
    1.32 + *  major revision), and patchlevel (increments with fixes to the minor
    1.33 + *  revision).
    1.34 + *
    1.35 + * \sa SDL_VERSION
    1.36 + * \sa SDL_GetVersion
    1.37 + */
    1.38 +typedef struct SDL_version
    1.39 +{
    1.40 +    Uint8 major;        /**< major version */
    1.41 +    Uint8 minor;        /**< minor version */
    1.42 +    Uint8 patch;        /**< update version */
    1.43 +} SDL_version;
    1.44 +
    1.45  /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
    1.46  */
    1.47  #define SDL_MAJOR_VERSION	1
    1.48 -#define SDL_MINOR_VERSION	2
    1.49 -#define SDL_PATCHLEVEL		11
    1.50 +#define SDL_MINOR_VERSION	3
    1.51 +#define SDL_PATCHLEVEL		0
    1.52  
    1.53 -typedef struct SDL_version {
    1.54 -	Uint8 major;
    1.55 -	Uint8 minor;
    1.56 -	Uint8 patch;
    1.57 -} SDL_version;
    1.58 -
    1.59 -/* This macro can be used to fill a version structure with the compile-time
    1.60 - * version of the SDL library.
    1.61 +/**
    1.62 + * \def SDL_VERSION(x)
    1.63 + * \brief Macro to determine SDL version program was compiled against.
    1.64 + *
    1.65 + * This macro fills in a SDL_version structure with the version of the
    1.66 + *  library you compiled against. This is determined by what header the
    1.67 + *  compiler uses. Note that if you dynamically linked the library, you might
    1.68 + *  have a slightly newer or older version at runtime. That version can be
    1.69 + *  determined with SDL_GetVersion(), which, unlike SDL_VERSION,
    1.70 + *  is not a macro.
    1.71 + *
    1.72 + * \param x A pointer to a SDL_version struct to initialize.
    1.73 + *
    1.74 + * \sa SDL_version
    1.75 + * \sa SDL_GetVersion
    1.76   */
    1.77 -#define SDL_VERSION(X)							\
    1.78 +#define SDL_VERSION(x)							\
    1.79  {									\
    1.80 -	(X)->major = SDL_MAJOR_VERSION;					\
    1.81 -	(X)->minor = SDL_MINOR_VERSION;					\
    1.82 -	(X)->patch = SDL_PATCHLEVEL;					\
    1.83 +	(x)->major = SDL_MAJOR_VERSION;					\
    1.84 +	(x)->minor = SDL_MINOR_VERSION;					\
    1.85 +	(x)->patch = SDL_PATCHLEVEL;					\
    1.86  }
    1.87  
    1.88  /* This macro turns the version numbers into a numeric value:
    1.89 @@ -70,16 +103,42 @@
    1.90  #define SDL_VERSION_ATLEAST(X, Y, Z) \
    1.91  	(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
    1.92  
    1.93 -/* This function gets the version of the dynamically linked SDL library.
    1.94 -   it should NOT be used to fill a version structure, instead you should
    1.95 -   use the SDL_Version() macro.
    1.96 +/**
    1.97 + * \fn void SDL_GetVersion(SDL_version *ver)
    1.98 + * \brief Get the version of SDL that is linked against your program.
    1.99 + *
   1.100 + * If you are using a shared library (DLL) version of SDL, then it is
   1.101 + *  possible that it will be different than the version you compiled against.
   1.102 + *
   1.103 + * This is a real function; the macro SDL_VERSION tells you what version
   1.104 + *  of SDL you compiled against:
   1.105 + *
   1.106 + * \code
   1.107 + * SDL_version compiled;
   1.108 + * SDL_version linked;
   1.109 + *
   1.110 + * SDL_VERSION(&compiled);
   1.111 + * SDL_GetVersion(&linked);
   1.112 + * printf("We compiled against SDL version %d.%d.%d ...\n",
   1.113 + *           compiled.major, compiled.minor, compiled.patch);
   1.114 + * printf("But we linked against SDL version %d.%d.%d.\n",
   1.115 + *           linked.major, linked.minor, linked.patch);
   1.116 + * \endcode
   1.117 + *
   1.118 + * This function may be called safely at any time, even before SDL_Init().
   1.119 + *
   1.120 + * \sa SDL_VERSION
   1.121   */
   1.122 -extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
   1.123 +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
   1.124  
   1.125  /* Ends C function definitions when using C++ */
   1.126  #ifdef __cplusplus
   1.127 +/* *INDENT-OFF* */
   1.128  }
   1.129 +/* *INDENT-ON* */
   1.130  #endif
   1.131  #include "close_code.h"
   1.132  
   1.133  #endif /* _SDL_version_h */
   1.134 +
   1.135 +/* vi: set ts=4 sw=4 expandtab: */