1
0
Fork 0

Fix build failures with OPT = 0 due to inline functions (#19767)

Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
Sergey Vlasov 2023-02-12 09:14:34 +03:00 committed by GitHub
parent b1f4d49c43
commit 584b7cf801
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 1 deletions

View file

@ -29,6 +29,12 @@ inline void split_shared_memory_unlock(void){};
prefix##_unlock(); \
}
/* Generate an out-of-line implementation in case the inline functions defined
* by the above macro don't actually get inlined. */
#define QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(prefix) \
extern inline unsigned prefix##_autounlock_lock_helper(void); \
extern inline void prefix##_autounlock_unlock_helper(unsigned* unused_guard);
/* Convinience macro the automatically generate the correct RAII-style
* lock_autounlock function macro */
#define QMK_DECLARE_AUTOUNLOCK_CALL(prefix) unsigned prefix##_guard __attribute__((unused, cleanup(prefix##_autounlock_unlock_helper))) = prefix##_autounlock_lock_helper