1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 * GObject introspection: Versioning and export macros 3 * 4 * Copyright (C) 2014 Chun-wei Fan 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 22 #include <glib.h> 23 24 #ifndef __GIVERSIONMACROS_H__ 25 #define __GIVERSIONMACROS_H__ 26 27 #if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION) 28 #error "Only <girepository.h> can be included directly." 29 #endif 30 31 #ifndef _GI_EXTERN 32 #define _GI_EXTERN extern 33 #endif 34 35 #define GI_AVAILABLE_IN_ALL _GI_EXTERN 36 37 /* XXX: Every new stable minor release should add a set of macros here 38 * 39 * We are using the GLib versions here as the G-I minor versions 40 * need to be in sync with the GLib minor versions. Api's added 41 * at or before 1.30 are marked as GI_AVAILABLE_IN_ALL 42 */ 43 44 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32 45 # define GI_DEPRECATED_IN_1_32 GLIB_DEPRECATED 46 # define GI_DEPRECATED_IN_1_32_FOR(f) GLIB_DEPRECATED_FOR(f) 47 #else 48 # define GI_DEPRECATED_IN_1_32 _GI_EXTERN 49 # define GI_DEPRECATED_IN_1_32_FOR(f) _GI_EXTERN 50 #endif 51 52 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32 53 # define GI_AVAILABLE_IN_1_32 GLIB_UNAVAILABLE(2, 32) 54 #else 55 # define GI_AVAILABLE_IN_1_32 _GI_EXTERN 56 #endif 57 58 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34 59 # define GI_DEPRECATED_IN_1_34 GLIB_DEPRECATED 60 # define GI_DEPRECATED_IN_1_34_FOR(f) GLIB_DEPRECATED_FOR(f) 61 #else 62 # define GI_DEPRECATED_IN_1_34 _GI_EXTERN 63 # define GI_DEPRECATED_IN_1_34_FOR(f) _GI_EXTERN 64 #endif 65 66 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34 67 # define GI_AVAILABLE_IN_1_34 GLIB_UNAVAILABLE(2, 34) 68 #else 69 # define GI_AVAILABLE_IN_1_34 _GI_EXTERN 70 #endif 71 72 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36 73 # define GI_DEPRECATED_IN_1_36 GLIB_DEPRECATED 74 # define GI_DEPRECATED_IN_1_36_FOR(f) GLIB_DEPRECATED_FOR(f) 75 #else 76 # define GI_DEPRECATED_IN_1_36 _GI_EXTERN 77 # define GI_DEPRECATED_IN_1_36_FOR(f) _GI_EXTERN 78 #endif 79 80 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36 81 # define GI_AVAILABLE_IN_1_36 GLIB_UNAVAILABLE(2, 36) 82 #else 83 # define GI_AVAILABLE_IN_1_36 _GI_EXTERN 84 #endif 85 86 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38 87 # define GI_DEPRECATED_IN_1_38 GLIB_DEPRECATED 88 # define GI_DEPRECATED_IN_1_38_FOR(f) GLIB_DEPRECATED_FOR(f) 89 #else 90 # define GI_DEPRECATED_IN_1_38 _GI_EXTERN 91 # define GI_DEPRECATED_IN_1_38_FOR(f) _GI_EXTERN 92 #endif 93 94 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 95 # define GI_AVAILABLE_IN_1_38 GLIB_UNAVAILABLE(2, 38) 96 #else 97 # define GI_AVAILABLE_IN_1_38 _GI_EXTERN 98 #endif 99 100 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40 101 # define GI_DEPRECATED_IN_1_40 GLIB_DEPRECATED 102 # define GI_DEPRECATED_IN_1_40_FOR(f) GLIB_DEPRECATED_FOR(f) 103 #else 104 # define GI_DEPRECATED_IN_1_40 _GI_EXTERN 105 # define GI_DEPRECATED_IN_1_40_FOR(f) _GI_EXTERN 106 #endif 107 108 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40 109 # define GI_AVAILABLE_IN_1_40 GLIB_UNAVAILABLE(2, 40) 110 #else 111 # define GI_AVAILABLE_IN_1_40 _GI_EXTERN 112 #endif 113 114 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42 115 # define GI_DEPRECATED_IN_1_42 GLIB_DEPRECATED 116 # define GI_DEPRECATED_IN_1_42_FOR(f) GLIB_DEPRECATED_FOR(f) 117 #else 118 # define GI_DEPRECATED_IN_1_42 _GI_EXTERN 119 # define GI_DEPRECATED_IN_1_42_FOR(f) _GI_EXTERN 120 #endif 121 122 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42 123 # define GI_AVAILABLE_IN_1_42 GLIB_UNAVAILABLE(2, 42) 124 #else 125 # define GI_AVAILABLE_IN_1_42 _GI_EXTERN 126 #endif 127 128 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44 129 # define GI_DEPRECATED_IN_1_44 GLIB_DEPRECATED 130 # define GI_DEPRECATED_IN_1_44_FOR(f) GLIB_DEPRECATED_FOR(f) 131 #else 132 # define GI_DEPRECATED_IN_1_44 _GI_EXTERN 133 # define GI_DEPRECATED_IN_1_44_FOR(f) _GI_EXTERN 134 #endif 135 136 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44 137 # define GI_AVAILABLE_IN_1_44 GLIB_UNAVAILABLE(2, 44) 138 #else 139 # define GI_AVAILABLE_IN_1_44 _GI_EXTERN 140 #endif 141 142 #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46 143 # define GI_DEPRECATED_IN_1_46 GLIB_DEPRECATED 144 # define GI_DEPRECATED_IN_1_46_FOR(f) GLIB_DEPRECATED_FOR(f) 145 #else 146 # define GI_DEPRECATED_IN_1_46 _GI_EXTERN 147 # define GI_DEPRECATED_IN_1_46_FOR(f) _GI_EXTERN 148 #endif 149 150 #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46 151 # define GI_AVAILABLE_IN_1_46 GLIB_UNAVAILABLE(2, 46) 152 #else 153 # define GI_AVAILABLE_IN_1_46 _GI_EXTERN 154 #endif 155 156 #if defined(GLIB_VERSION_2_60) && GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_60 157 # define GI_AVAILABLE_IN_1_60 GLIB_UNAVAILABLE(2, 60) 158 #else 159 # define GI_AVAILABLE_IN_1_60 _GI_EXTERN 160 #endif 161 162 #if defined(GLIB_VERSION_2_66) && GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_66 163 # define GI_AVAILABLE_IN_1_66 GLIB_UNAVAILABLE(2, 66) 164 #else 165 # define GI_AVAILABLE_IN_1_66 _GI_EXTERN 166 #endif 167 168 #if defined(GLIB_VERSION_2_70) && GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_70 169 # define GI_AVAILABLE_IN_1_70 GLIB_UNAVAILABLE(2, 70) 170 #else 171 # define GI_AVAILABLE_IN_1_70 _GI_EXTERN 172 #endif 173 174 #endif /* __GIVERSIONMACROS_H__ */ 175