gmacros.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. /* GLIB - Library of useful routines for C programming
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*
  18. * Modified by the GLib Team and others 1997-2000. See the AUTHORS
  19. * file for a list of people on the GLib Team. See the ChangeLog
  20. * files for a list of changes. These files are distributed with
  21. * GLib at ftp://ftp.gtk.org/pub/gtk/.
  22. */
  23. /* This file must not include any other glib header file and must thus
  24. * not refer to variables from glibconfig.h
  25. */
  26. #ifndef __G_MACROS_H__
  27. #define __G_MACROS_H__
  28. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  29. #error "Only <glib.h> can be included directly."
  30. #endif
  31. /* We include stddef.h to get the system's definition of NULL
  32. */
  33. #include <stddef.h>
  34. #define G_GNUC_CHECK_VERSION(major, minor) \
  35. (defined(__GNUC__) && \
  36. ((__GNUC__ > (major)) || \
  37. ((__GNUC__ == (major)) && \
  38. (__GNUC_MINOR__ >= (minor)))))
  39. /* Here we provide G_GNUC_EXTENSION as an alias for __extension__,
  40. * where this is valid. This allows for warningless compilation of
  41. * "long long" types even in the presence of '-ansi -pedantic'.
  42. */
  43. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
  44. #define G_GNUC_EXTENSION __extension__
  45. #else
  46. #define G_GNUC_EXTENSION
  47. #endif
  48. /* Every compiler that we target supports inlining, but some of them may
  49. * complain about it if we don't say "__inline". If we have C99, or if
  50. * we are using C++, then we can use "inline" directly. Unfortunately
  51. * Visual Studio does not support __STDC_VERSION__, so we need to check
  52. * whether we are on Visual Studio 2013 or earlier to see that we need to
  53. * say "__inline" in C mode.
  54. * Otherwise, we say "__inline" to avoid the warning.
  55. */
  56. #define G_CAN_INLINE
  57. #ifndef __cplusplus
  58. # ifdef _MSC_VER
  59. # if (_MSC_VER < 1900)
  60. # define G_INLINE_DEFINE_NEEDED
  61. # endif
  62. # elif !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199900)
  63. # define G_INLINE_DEFINE_NEEDED
  64. # endif
  65. #endif
  66. #ifdef G_INLINE_DEFINE_NEEDED
  67. # undef inline
  68. # define inline __inline
  69. #endif
  70. #undef G_INLINE_DEFINE_NEEDED
  71. /* For historical reasons we need to continue to support those who
  72. * define G_IMPLEMENT_INLINES to mean "don't implement this here".
  73. */
  74. #ifdef G_IMPLEMENT_INLINES
  75. # define G_INLINE_FUNC extern
  76. # undef G_CAN_INLINE
  77. #else
  78. # define G_INLINE_FUNC static inline
  79. #endif /* G_IMPLEMENT_INLINES */
  80. /* Provide macros to feature the GCC function attribute.
  81. */
  82. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
  83. #define G_GNUC_PURE __attribute__((__pure__))
  84. #define G_GNUC_MALLOC __attribute__((__malloc__))
  85. #else
  86. #define G_GNUC_PURE
  87. #define G_GNUC_MALLOC
  88. #endif
  89. #if __GNUC__ >= 4
  90. #define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
  91. #else
  92. #define G_GNUC_NULL_TERMINATED
  93. #endif
  94. /* Clang feature detection: http://clang.llvm.org/docs/LanguageExtensions.html */
  95. #ifndef __has_attribute
  96. #define __has_attribute(x) 0
  97. #endif
  98. #ifndef __has_feature
  99. #define __has_feature(x) 0
  100. #endif
  101. #ifndef __has_builtin
  102. #define __has_builtin(x) 0
  103. #endif
  104. #if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
  105. (defined(__clang__) && __has_attribute(__alloc_size__))
  106. #define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
  107. #define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
  108. #else
  109. #define G_GNUC_ALLOC_SIZE(x)
  110. #define G_GNUC_ALLOC_SIZE2(x,y)
  111. #endif
  112. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  113. #define G_GNUC_PRINTF( format_idx, arg_idx ) \
  114. __attribute__((__format__ (__printf__, format_idx, arg_idx)))
  115. #define G_GNUC_SCANF( format_idx, arg_idx ) \
  116. __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
  117. #define G_GNUC_FORMAT( arg_idx ) \
  118. __attribute__((__format_arg__ (arg_idx)))
  119. #define G_GNUC_NORETURN \
  120. __attribute__((__noreturn__))
  121. #define G_GNUC_CONST \
  122. __attribute__((__const__))
  123. #define G_GNUC_UNUSED \
  124. __attribute__((__unused__))
  125. #define G_GNUC_NO_INSTRUMENT \
  126. __attribute__((__no_instrument_function__))
  127. #else /* !__GNUC__ */
  128. #define G_GNUC_PRINTF( format_idx, arg_idx )
  129. #define G_GNUC_SCANF( format_idx, arg_idx )
  130. #define G_GNUC_FORMAT( arg_idx )
  131. #define G_GNUC_NORETURN
  132. #define G_GNUC_CONST
  133. #define G_GNUC_UNUSED
  134. #define G_GNUC_NO_INSTRUMENT
  135. #endif /* !__GNUC__ */
  136. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  137. #define G_GNUC_DEPRECATED __attribute__((__deprecated__))
  138. #else
  139. #define G_GNUC_DEPRECATED
  140. #endif /* __GNUC__ */
  141. #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  142. #define G_GNUC_DEPRECATED_FOR(f) \
  143. __attribute__((deprecated("Use " #f " instead")))
  144. #else
  145. #define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED
  146. #endif /* __GNUC__ */
  147. #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
  148. #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  149. _Pragma ("GCC diagnostic push") \
  150. _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
  151. #define G_GNUC_END_IGNORE_DEPRECATIONS \
  152. _Pragma ("GCC diagnostic pop")
  153. #elif defined (_MSC_VER) && (_MSC_VER >= 1500)
  154. #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  155. __pragma (warning (push)) \
  156. __pragma (warning (disable : 4996))
  157. #define G_GNUC_END_IGNORE_DEPRECATIONS \
  158. __pragma (warning (pop))
  159. #elif defined (__clang__)
  160. #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  161. _Pragma("clang diagnostic push") \
  162. _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
  163. #define G_GNUC_END_IGNORE_DEPRECATIONS \
  164. _Pragma("clang diagnostic pop")
  165. #else
  166. #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
  167. #define G_GNUC_END_IGNORE_DEPRECATIONS
  168. #endif
  169. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
  170. #define G_GNUC_MAY_ALIAS __attribute__((may_alias))
  171. #else
  172. #define G_GNUC_MAY_ALIAS
  173. #endif
  174. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  175. #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  176. #else
  177. #define G_GNUC_WARN_UNUSED_RESULT
  178. #endif /* __GNUC__ */
  179. #ifndef G_DISABLE_DEPRECATED
  180. /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
  181. * macros, so we can refer to them as strings unconditionally.
  182. * usage not-recommended since gcc-3.0
  183. */
  184. #if defined (__GNUC__) && (__GNUC__ < 3)
  185. #define G_GNUC_FUNCTION __FUNCTION__
  186. #define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__
  187. #else /* !__GNUC__ */
  188. #define G_GNUC_FUNCTION ""
  189. #define G_GNUC_PRETTY_FUNCTION ""
  190. #endif /* !__GNUC__ */
  191. #endif /* !G_DISABLE_DEPRECATED */
  192. #if __has_feature(attribute_analyzer_noreturn) && defined(__clang_analyzer__)
  193. #define G_ANALYZER_ANALYZING 1
  194. #define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
  195. #else
  196. #define G_ANALYZER_ANALYZING 0
  197. #define G_ANALYZER_NORETURN
  198. #endif
  199. #define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
  200. #define G_STRINGIFY_ARG(contents) #contents
  201. #ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
  202. #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
  203. #define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
  204. #ifdef __COUNTER__
  205. #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
  206. #else
  207. #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __LINE__)[(expr) ? 1 : -1] G_GNUC_UNUSED
  208. #endif
  209. #define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
  210. #endif
  211. /* Provide a string identifying the current code position */
  212. #if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__cplusplus)
  213. #define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
  214. #else
  215. #define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
  216. #endif
  217. /* Provide a string identifying the current function, non-concatenatable */
  218. #if defined (__GNUC__) && defined (__cplusplus)
  219. #define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
  220. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  221. #define G_STRFUNC ((const char*) (__func__))
  222. #elif defined (__GNUC__) || (defined(_MSC_VER) && (_MSC_VER > 1300))
  223. #define G_STRFUNC ((const char*) (__FUNCTION__))
  224. #else
  225. #define G_STRFUNC ((const char*) ("???"))
  226. #endif
  227. /* Guard C code in headers, while including them from C++ */
  228. #ifdef __cplusplus
  229. #define G_BEGIN_DECLS extern "C" {
  230. #define G_END_DECLS }
  231. #else
  232. #define G_BEGIN_DECLS
  233. #define G_END_DECLS
  234. #endif
  235. /* Provide definitions for some commonly used macros.
  236. * Some of them are only provided if they haven't already
  237. * been defined. It is assumed that if they are already
  238. * defined then the current definition is correct.
  239. */
  240. #ifndef NULL
  241. # ifdef __cplusplus
  242. # define NULL (0L)
  243. # else /* !__cplusplus */
  244. # define NULL ((void*) 0)
  245. # endif /* !__cplusplus */
  246. #endif
  247. #ifndef FALSE
  248. #define FALSE (0)
  249. #endif
  250. #ifndef TRUE
  251. #define TRUE (!FALSE)
  252. #endif
  253. #undef MAX
  254. #define MAX(a, b) (((a) > (b)) ? (a) : (b))
  255. #undef MIN
  256. #define MIN(a, b) (((a) < (b)) ? (a) : (b))
  257. #undef ABS
  258. #define ABS(a) (((a) < 0) ? -(a) : (a))
  259. #undef CLAMP
  260. #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
  261. /* Count the number of elements in an array. The array must be defined
  262. * as such; using this with a dynamically allocated array will give
  263. * incorrect results.
  264. */
  265. #define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
  266. /* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
  267. */
  268. #define GPOINTER_TO_SIZE(p) ((gsize) (p))
  269. #define GSIZE_TO_POINTER(s) ((gpointer) (gsize) (s))
  270. /* Provide convenience macros for handling structure
  271. * fields through their offsets.
  272. */
  273. #if (defined(__GNUC__) && __GNUC__ >= 4) || defined (_MSC_VER)
  274. #define G_STRUCT_OFFSET(struct_type, member) \
  275. ((glong) offsetof (struct_type, member))
  276. #else
  277. #define G_STRUCT_OFFSET(struct_type, member) \
  278. ((glong) ((guint8*) &((struct_type*) 0)->member))
  279. #endif
  280. #define G_STRUCT_MEMBER_P(struct_p, struct_offset) \
  281. ((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
  282. #define G_STRUCT_MEMBER(member_type, struct_p, struct_offset) \
  283. (*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
  284. /* Provide simple macro statement wrappers:
  285. * G_STMT_START { statements; } G_STMT_END;
  286. * This can be used as a single statement, like:
  287. * if (x) G_STMT_START { ... } G_STMT_END; else ...
  288. * This intentionally does not use compiler extensions like GCC's '({...})' to
  289. * avoid portability issue or side effects when compiled with different compilers.
  290. * MSVC complains about "while(0)": C4127: "Conditional expression is constant",
  291. * so we use __pragma to avoid the warning since the use here is intentional.
  292. */
  293. #if !(defined (G_STMT_START) && defined (G_STMT_END))
  294. #define G_STMT_START do
  295. #if defined (_MSC_VER) && (_MSC_VER >= 1500)
  296. #define G_STMT_END \
  297. __pragma(warning(push)) \
  298. __pragma(warning(disable:4127)) \
  299. while(0) \
  300. __pragma(warning(pop))
  301. #else
  302. #define G_STMT_END while (0)
  303. #endif
  304. #endif
  305. /* Deprecated -- do not use. */
  306. #ifndef G_DISABLE_DEPRECATED
  307. #ifdef G_DISABLE_CONST_RETURNS
  308. #define G_CONST_RETURN
  309. #else
  310. #define G_CONST_RETURN const
  311. #endif
  312. #endif
  313. /*
  314. * The G_LIKELY and G_UNLIKELY macros let the programmer give hints to
  315. * the compiler about the expected result of an expression. Some compilers
  316. * can use this information for optimizations.
  317. *
  318. * The _G_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
  319. * putting assignments in g_return_if_fail ().
  320. */
  321. #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
  322. #define _G_BOOLEAN_EXPR(expr) \
  323. G_GNUC_EXTENSION ({ \
  324. int _g_boolean_var_; \
  325. if (expr) \
  326. _g_boolean_var_ = 1; \
  327. else \
  328. _g_boolean_var_ = 0; \
  329. _g_boolean_var_; \
  330. })
  331. #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1))
  332. #define G_UNLIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 0))
  333. #else
  334. #define G_LIKELY(expr) (expr)
  335. #define G_UNLIKELY(expr) (expr)
  336. #endif
  337. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  338. #define G_DEPRECATED __attribute__((__deprecated__))
  339. #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
  340. #define G_DEPRECATED __declspec(deprecated)
  341. #else
  342. #define G_DEPRECATED
  343. #endif
  344. #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  345. #define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
  346. #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
  347. #define G_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
  348. #else
  349. #define G_DEPRECATED_FOR(f) G_DEPRECATED
  350. #endif
  351. #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  352. #define G_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min)))
  353. #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
  354. #define G_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min))
  355. #else
  356. #define G_UNAVAILABLE(maj,min) G_DEPRECATED
  357. #endif
  358. #ifndef _GLIB_EXTERN
  359. #define _GLIB_EXTERN extern
  360. #endif
  361. /* These macros are used to mark deprecated functions in GLib headers,
  362. * and thus have to be exposed in installed headers. But please
  363. * do *not* use them in other projects. Instead, use G_DEPRECATED
  364. * or define your own wrappers around it.
  365. */
  366. #ifdef GLIB_DISABLE_DEPRECATION_WARNINGS
  367. #define GLIB_DEPRECATED _GLIB_EXTERN
  368. #define GLIB_DEPRECATED_FOR(f) _GLIB_EXTERN
  369. #define GLIB_UNAVAILABLE(maj,min) _GLIB_EXTERN
  370. #else
  371. #define GLIB_DEPRECATED G_DEPRECATED _GLIB_EXTERN
  372. #define GLIB_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GLIB_EXTERN
  373. #define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN
  374. #endif
  375. #ifdef __GNUC__
  376. /* these macros are private */
  377. #define _GLIB_AUTOPTR_FUNC_NAME(TypeName) glib_autoptr_cleanup_##TypeName
  378. #define _GLIB_AUTOPTR_TYPENAME(TypeName) TypeName##_autoptr
  379. #define _GLIB_AUTO_FUNC_NAME(TypeName) glib_auto_cleanup_##TypeName
  380. #define _GLIB_CLEANUP(func) __attribute__((cleanup(func)))
  381. #define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName) \
  382. typedef ModuleObjName *_GLIB_AUTOPTR_TYPENAME(ModuleObjName); \
  383. static inline void _GLIB_AUTOPTR_FUNC_NAME(ModuleObjName) (ModuleObjName **_ptr) { \
  384. _GLIB_AUTOPTR_FUNC_NAME(ParentName) ((ParentName **) _ptr); } \
  385. /* these macros are API */
  386. #define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func) \
  387. typedef TypeName *_GLIB_AUTOPTR_TYPENAME(TypeName); \
  388. G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  389. static inline void _GLIB_AUTOPTR_FUNC_NAME(TypeName) (TypeName **_ptr) { if (*_ptr) (func) (*_ptr); } \
  390. G_GNUC_END_IGNORE_DEPRECATIONS
  391. #define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func) \
  392. G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  393. static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { (func) (_ptr); } \
  394. G_GNUC_END_IGNORE_DEPRECATIONS
  395. #define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none) \
  396. G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
  397. static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { if (*_ptr != none) (func) (*_ptr); } \
  398. G_GNUC_END_IGNORE_DEPRECATIONS
  399. #define g_autoptr(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_TYPENAME(TypeName)
  400. #define g_auto(TypeName) _GLIB_CLEANUP(_GLIB_AUTO_FUNC_NAME(TypeName)) TypeName
  401. #define g_autofree _GLIB_CLEANUP(g_autoptr_cleanup_generic_gfree)
  402. #else /* not GNU C */
  403. /* this (dummy) macro is private */
  404. #define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName)
  405. /* these (dummy) macros are API */
  406. #define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
  407. #define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)
  408. #define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
  409. /* no declaration of g_auto() or g_autoptr() here */
  410. #endif
  411. #endif /* __G_MACROS_H__ */