_ASTCFLAGS+=-Werror
_ASTCFLAGS+=-Wunused
_ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
- _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
_ASTCFLAGS+=$(AST_TRAMPOLINES)
_ASTCFLAGS+=-Wundef
_ASTCFLAGS+=-Wmissing-format-attribute
# and if that doesn't fail then compile again with optimizer disabled
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
COMPILE_DOUBLE=yes
+else
+_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
endif
ifeq ($(findstring BUILD_NATIVE,$(MENUSELECT_CFLAGS)),BUILD_NATIVE)
int __ao2_ref_debug(void *o, int delta, const char *tag, const char *file, int line, const char *func);
int __ao2_ref(void *o, int delta);
+/*!
+ * \since 12.4.0
+ * \brief Replace one object reference with another cleaning up the original.
+ *
+ * \param dst Pointer to the object that will be cleaned up.
+ * \param src Pointer to the object replacing it.
+ */
+#define ao2_replace(dst, src) \
+ {\
+ typeof(dst) *__dst_ ## __LINE__ = &dst; \
+ typeof(src) __src_ ## __LINE__ = src; \
+ if (__src_ ## __LINE__) {\
+ ao2_ref(__src_ ## __LINE__, +1); \
+ } \
+ if (*__dst_ ## __LINE__) {\
+ ao2_ref(*__dst_ ## __LINE__, -1); \
+ } \
+ *__dst_ ## __LINE__ = __src_ ## __LINE__; \
+ }
+
/*! @} */
/*! \brief Which lock to request. */