giversionmacros.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. #include <glib.h>
  22. #ifndef __GIVERSIONMACROS_H__
  23. #define __GIVERSIONMACROS_H__
  24. #if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION)
  25. #error "Only <girepository.h> can be included directly."
  26. #endif
  27. #ifndef _GI_EXTERN
  28. #define _GI_EXTERN extern
  29. #endif
  30. #define GI_AVAILABLE_IN_ALL _GI_EXTERN
  31. /* XXX: Every new stable minor release should add a set of macros here
  32. *
  33. * We are using the GLib versions here as the G-I minor versions
  34. * need to be in sync with the GLib minor versions. Api's added
  35. * at or before 1.30 are marked as GI_AVAILABLE_IN_ALL
  36. */
  37. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32
  38. # define GI_DEPRECATED_IN_1_32 GLIB_DEPRECATED
  39. # define GI_DEPRECATED_IN_1_32_FOR(f) GLIB_DEPRECATED_FOR(f)
  40. #else
  41. # define GI_DEPRECATED_IN_1_32 _GI_EXTERN
  42. # define GI_DEPRECATED_IN_1_32_FOR(f) _GI_EXTERN
  43. #endif
  44. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32
  45. # define GI_AVAILABLE_IN_1_32 GLIB_UNAVAILABLE(2, 32)
  46. #else
  47. # define GI_AVAILABLE_IN_1_32 _GI_EXTERN
  48. #endif
  49. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34
  50. # define GI_DEPRECATED_IN_1_34 GLIB_DEPRECATED
  51. # define GI_DEPRECATED_IN_1_34_FOR(f) GLIB_DEPRECATED_FOR(f)
  52. #else
  53. # define GI_DEPRECATED_IN_1_34 _GI_EXTERN
  54. # define GI_DEPRECATED_IN_1_34_FOR(f) _GI_EXTERN
  55. #endif
  56. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34
  57. # define GI_AVAILABLE_IN_1_34 GLIB_UNAVAILABLE(2, 34)
  58. #else
  59. # define GI_AVAILABLE_IN_1_34 _GI_EXTERN
  60. #endif
  61. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36
  62. # define GI_DEPRECATED_IN_1_36 GLIB_DEPRECATED
  63. # define GI_DEPRECATED_IN_1_36_FOR(f) GLIB_DEPRECATED_FOR(f)
  64. #else
  65. # define GI_DEPRECATED_IN_1_36 _GI_EXTERN
  66. # define GI_DEPRECATED_IN_1_36_FOR(f) _GI_EXTERN
  67. #endif
  68. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36
  69. # define GI_AVAILABLE_IN_1_36 GLIB_UNAVAILABLE(2, 36)
  70. #else
  71. # define GI_AVAILABLE_IN_1_36 _GI_EXTERN
  72. #endif
  73. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38
  74. # define GI_DEPRECATED_IN_1_38 GLIB_DEPRECATED
  75. # define GI_DEPRECATED_IN_1_38_FOR(f) GLIB_DEPRECATED_FOR(f)
  76. #else
  77. # define GI_DEPRECATED_IN_1_38 _GI_EXTERN
  78. # define GI_DEPRECATED_IN_1_38_FOR(f) _GI_EXTERN
  79. #endif
  80. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  81. # define GI_AVAILABLE_IN_1_38 GLIB_UNAVAILABLE(2, 38)
  82. #else
  83. # define GI_AVAILABLE_IN_1_38 _GI_EXTERN
  84. #endif
  85. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40
  86. # define GI_DEPRECATED_IN_1_40 GLIB_DEPRECATED
  87. # define GI_DEPRECATED_IN_1_40_FOR(f) GLIB_DEPRECATED_FOR(f)
  88. #else
  89. # define GI_DEPRECATED_IN_1_40 _GI_EXTERN
  90. # define GI_DEPRECATED_IN_1_40_FOR(f) _GI_EXTERN
  91. #endif
  92. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40
  93. # define GI_AVAILABLE_IN_1_40 GLIB_UNAVAILABLE(2, 40)
  94. #else
  95. # define GI_AVAILABLE_IN_1_40 _GI_EXTERN
  96. #endif
  97. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42
  98. # define GI_DEPRECATED_IN_1_42 GLIB_DEPRECATED
  99. # define GI_DEPRECATED_IN_1_42_FOR(f) GLIB_DEPRECATED_FOR(f)
  100. #else
  101. # define GI_DEPRECATED_IN_1_42 _GI_EXTERN
  102. # define GI_DEPRECATED_IN_1_42_FOR(f) _GI_EXTERN
  103. #endif
  104. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42
  105. # define GI_AVAILABLE_IN_1_42 GLIB_UNAVAILABLE(2, 42)
  106. #else
  107. # define GI_AVAILABLE_IN_1_42 _GI_EXTERN
  108. #endif
  109. #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44
  110. # define GI_DEPRECATED_IN_1_44 GLIB_DEPRECATED
  111. # define GI_DEPRECATED_IN_1_44_FOR(f) GLIB_DEPRECATED_FOR(f)
  112. #else
  113. # define GI_DEPRECATED_IN_1_44 _GI_EXTERN
  114. # define GI_DEPRECATED_IN_1_44_FOR(f) _GI_EXTERN
  115. #endif
  116. #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
  117. # define GI_AVAILABLE_IN_1_44 GLIB_UNAVAILABLE(2, 44)
  118. #else
  119. # define GI_AVAILABLE_IN_1_44 _GI_EXTERN
  120. #endif
  121. #endif /* __GIVERSIONMACROS_H__ */