*: generalize "const trick"

While at it, change all "__asm__" to "asm"

Co-authored-by: canyie <31466456+canyie@users.noreply.github.com>
Signed-off-by: YU Jincheng <shana@zju.edu.cn>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
YU Jincheng
2021-09-29 17:37:26 +08:00
committed by Denys Vlasenko
parent 17e6fb06b3
commit 1f925038ab
6 changed files with 34 additions and 38 deletions

View File

@@ -435,7 +435,7 @@ struct test_statics {
};
/* See test_ptr_hack.c */
extern struct test_statics *const test_ptr_to_statics;
extern struct test_statics *BB_GLOBAL_CONST test_ptr_to_statics;
#define S (*test_ptr_to_statics)
#define args (S.args )
@@ -446,8 +446,7 @@ extern struct test_statics *const test_ptr_to_statics;
#define leaving (S.leaving )
#define INIT_S() do { \
(*(struct test_statics**)not_const_pp(&test_ptr_to_statics)) = xzalloc(sizeof(S)); \
barrier(); \
ASSIGN_CONST_PTR(test_ptr_to_statics, xzalloc(sizeof(S))); \
} while (0)
#define DEINIT_S() do { \
free(group_array); \