Ignore:
Timestamp:
Sep 15, 2008, 8:47:37 PM (15 years ago)
Author:
Peter
Message:

Added structure to deprecate functions. I chose to use a gcc style,
and it is tested in configure whether the compiler supports it. If not
the deprecation has no effect. Using a deprecated function will cause
a compiler warning. In gcc the warning can be turned off with
'-Wno-deprecated'. Possibly we should turn off the warning by default,
so a user has to turn it on by defining
-DYAT_DISABLE_DEPRECATED...

fixes #367

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/config_public.h.in

    r1496 r1500  
    1 #ifndef _theplu_yat_utility_version_
    2 #define _theplu_yat_utility_version_
     1#ifndef _theplu_yat_utility_config_public_
     2#define _theplu_yat_utility_config_public_
    33
    44// @configure_input@
     
    2626
    2727///
    28 /// \file utility/version.h
     28/// \file utility/config_public.h
    2929///
    3030
    31 /*
    32   Compile-time version constants
    33 
    34   \see http://apr.apache.org/versioning.html
    35 */
    36 
    37 /**
    38    MAJOR version
    39 
    40    No compatibility is guarenteed between MAJOR versions.
    41 
    42    \since New in yat 0.5
    43  */
    44 #define YAT_MAJOR_VERSION @YAT_MAJOR_VERSION@
    45 
    46 /**
    47    MINOR version
    48 
    49    Minor API changes that do not cause binary compatibility problems.
    50    Reset to 0 when upgrading YAT_MAJOR_VERSION
    51 
    52    \since New in yat 0.5
    53  */
    54 #define YAT_MINOR_VERSION @YAT_MINOR_VERSION@
    55 
    56 /**
    57    PATCH version
    58 
    59    The Patch level never includes API changes, simply bug fixes.
    60    Reset to 0 when upgrading YAT_MINOR_VERSION
    61 
    62    \since New in yat 0.5
    63  */
    64 #define YAT_PATCH_VERSION @YAT_PATCH_VERSION@
    65 
    66 /**
    67    VERSION
    68 
    69    The version of yat in string format
    70 
    71    \since New in yat 0.5
    72  */
    73 #define YAT_VERSION "@VERSION@"
    74 
    75 /**
    76    DEV_BUILD
    77 
    78    Is set to false in releases
    79 
    80    \since New in yat 0.5
    81  */
    82 #define YAT_DEV_BUILD @YAT_DEV_BUILD@
    83 
    84 /**
    85    Check at compile time if the version of yat is at least a certain
    86    level.
    87    @param major The major version component of the version checked
    88    for (e.g., the "0" of "0.5.1").
    89    @param minor The minor version component of the version checked
    90    for (e.g., the "5" of "0.5.1").
    91    @param patch The patch level component of the version checked
    92    for (e.g., the "1" of "0.5.1").
    93 
    94    \since New in yat 0.5
    95  */
    96 #define YAT_VERSION_AT_LEAST(major,minor,patch)                    \
    97 (((major) < YAT_MAJOR_VERSION) ||                                    \
    98  ((major) == YAT_MAJOR_VERSION && (minor) < YAT_MINOR_VERSION) || \
    99  ((major) == YAT_MAJOR_VERSION && (minor) == YAT_MINOR_VERSION &&\
    100   (patch) <= YAT_PATCH_VERSION))
    101 
    102 #include <string>
    103 
    104 namespace theplu {
    105 namespace yat {
    106 namespace utility {
    107 
    108   /**
    109      \return major version number of compiled yat library
    110 
    111    \since New in yat 0.5
    112    */
    113   unsigned int major_version(void);
    114 
    115   /**
    116      \return minor version number of compiled yat library
    117 
    118      \since New in yat 0.5
    119    */
    120   unsigned int minor_version(void);
    121 
    122   /**
    123      \return patch version number of compiled yat library
    124 
    125      \since New in yat 0.5
    126    */
    127   unsigned int patch_version(void);
    128 
    129   /**
    130      \return version number of compiled yat library
    131 
    132      \since New in yat 0.5
    133    */
    134   std::string version(void);
    135 
    136 }}} // of namespace utility, yat, and theplu
     31/// Define if compiler supports deprecated attribute, as in g++ 4.0
     32#undef YAT_HAVE_GCC_DEPRECATED
    13733
    13834#endif
Note: See TracChangeset for help on using the changeset viewer.