From 62a6cd63b7097665d0862394af6eb21f84371c81 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Fri, 7 Feb 2020 00:25:52 +0100 Subject: [PATCH] Ensure unique names for section pointers accross files --- src/include/distributed/commands.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index e81a66ca2..94f19bded 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -82,9 +82,11 @@ typedef struct DistributedObjectOpsContainer #define PP_CAT_II(p, res) res #define REGISTER_SECTION_POINTER(section_name, ptr) \ - void *PP_CAT(section_name, __COUNTER__) \ + void *PP_CAT3(section_name, ptr, __COUNTER__) \ + __attribute__((unused)) \ __attribute__((section("__DATA," # section_name))) \ - = ptr \ + = &ptr + #define SECTION_ARRAY(_type, _section) \ extern _type __start_ ## _section[] __asm("section$start$__DATA$" # _section); \ @@ -99,7 +101,7 @@ typedef struct DistributedObjectOpsContainer .type = T_ ## stmt, \ .ops = &opsvar, \ }; \ - REGISTER_SECTION_POINTER(opscontainer, &PP_CAT(opscontainer, opsvar)) + REGISTER_SECTION_POINTER(opscontainer, PP_CAT(opscontainer, opsvar)) #define REGISTER_DISTRIBUTED_OPERATION_NESTED(stmt, objectVarName, objtype, opsvar) \ static DistributedObjectOpsContainer PP_CAT3(opscontainer_, stmt, objtype) = { \ @@ -109,7 +111,7 @@ typedef struct DistributedObjectOpsContainer .nestedType = objtype, \ .ops = &opsvar, \ }; \ - REGISTER_SECTION_POINTER(opscontainer, &PP_CAT3(opscontainer_, stmt, objtype)) + REGISTER_SECTION_POINTER(opscontainer, PP_CAT3(opscontainer_, stmt, objtype)) #define REGISTER_DISTRIBUTED_OPERATION_NESTED_NEW(stmt, objectVarName, objtype) \ static DistributeObjectOps PP_CAT3(distops, stmt, objtype); \