1 /* 2 * Copyright (C) 2012-2020 all contributors <cmogstored-public@yhbt.net> 3 * License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt> 4 */ 5 #define MOG_PRINTF __attribute__((format(printf,1,2))) 6 #define MOG_LIKELY(x) (__builtin_expect((x), 1)) 7 #define MOG_UNLIKELY(x) (__builtin_expect((x), 0)) 8 #define MOG_NOINLINE __attribute__((noinline)) 9 #define MOG_CHECK __attribute__((warn_unused_result)) 10 #define mog_sync_add_and_fetch(dst,val) __sync_add_and_fetch((dst),(val)) 11 #define mog_sync_sub_and_fetch(dst,val) __sync_sub_and_fetch((dst),(val)) 12 13 /* need the synchronization, right? */ 14 #define mog_sync_fetch(dst) mog_sync_add_and_fetch((dst),0) 15