#ifndef/#define/#endif not working on z80asm if called multiple times

Bug reports (if you don't/won't have a Github account)
Post Reply
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

#ifndef/#define/#endif not working on z80asm if called multiple times

Post by DarkSchneider »

I have a base define header with typical:

Code: Select all

#ifndef MEMMAPPER_DEFS_H_
#define MEMMAPPER_DEFS_H_
...
#endif
Then have another 2 that uses it:

Code: Select all

#ifndef MEMMAPPER_TABLE_ASM_
#define MEMMAPPER_TABLE_ASM_

include "memmapper_defs.h"
...
#endif

Code: Select all

#ifndef MEMMAPPER_INFO_ASM_
#define MEMMAPPER_INFO_ASM_

include "memmapper_defs.h"
...
#endif
If I call only one from other sources there is no problem, but if I have this:

Code: Select all

include "memmapper_table.asm"
include "memmapper_info.asm"
I get error for duplicate definitions, starting with MEMMAPPER_DEFS_H_ (the own of the #ifndef).
If I modify the memmapper_defs.h removing the # from the #define:

Code: Select all

#ifndef MEMMAPPER_DEFS_H_
define MEMMAPPER_DEFS_H_
...
#endif
It works. So seems to be an issue about defining non-valued symbols with the #define version instead without #.
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

Re: #ifndef/#define/#endif not working on z80asm if called multiple times

Post by DarkSchneider »

All the other #define with values within the header works without any issue of duplicated.
User avatar
dom
Well known member
Posts: 2014
Joined: Sun Jul 15, 2007 10:01 pm

Re: #ifndef/#define/#endif not working on z80asm if called multiple times

Post by dom »

Thanks for the report. Paulo has spotted the problem and the 20230617 nightly should have a fix.
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

Re: #ifndef/#define/#endif not working on z80asm if called multiple times

Post by DarkSchneider »

Now it works fine. Thanks.
Post Reply