Skip to content

Commit 2d0a0fc

Browse files
ninolomatadanielRep
authored andcommitted
feat(clang): refactor headers generation for clang
Clang assembler requires valid assembly; otherwise, an error is thrown. Instead of using "->" as the token to parse for assembly macro defines, we define the tokens "#", which is used for comments in assembly files. The generated output will be valid for both clang and gcc. Signed-off-by: Bruno Sa <[email protected]>
1 parent a0e323b commit 2d0a0fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/inc/util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
#ifndef __ASSEMBLER__
3535

3636
#define DEFINE_OFFSET(SYMBOL, STRUCT, FIELD) \
37-
__asm__ volatile("\n-> " XSTR(SYMBOL) " %0 \n" : : "i"(offsetof(STRUCT, FIELD)))
37+
__asm__ volatile("\n## " XSTR(SYMBOL) " %0 \n" : : "i"(offsetof(STRUCT, FIELD)))
3838

3939
#define DEFINE_SIZE(SYMBOL, TYPE) \
40-
__asm__ volatile("\n-> " XSTR(SYMBOL) " %0 \n" : : "i"(sizeof(TYPE)))
40+
__asm__ volatile("\n## " XSTR(SYMBOL) " %0 \n" : : "i"(sizeof(TYPE)))
4141

4242
#define max(n1, n2) (((n1) > (n2)) ? (n1) : (n2))
4343
#define min(n1, n2) (((n1) < (n2)) ? (n1) : (n2))

0 commit comments

Comments
 (0)