diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-06-01 19:08:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-01 19:08:32 +0000 |
| commit | c99313762a9663ad3749eca2c51a44c546a93fe7 (patch) | |
| tree | 6fca73b00e6b737c794b1467025698ab2e4e8362 /lib/prefix.h | |
| parent | 465d4a6c5b341de72fdd2a7de6458fc3968cf5cd (diff) | |
| parent | b0b14dfdd13963ab07889602d132ac218ce8526c (diff) | |
Merge pull request #8353 from opensourcerouting/llvm-20210327
Diffstat (limited to 'lib/prefix.h')
| -rw-r--r-- | lib/prefix.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index d7ee1b8e4c..217a23d561 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -315,10 +315,12 @@ struct prefix_sg { #ifndef __cplusplus #define prefixtype(uname, typename, fieldname) \ typename *fieldname; +#define TRANSPARENT_UNION __attribute__((transparent_union)) #else #define prefixtype(uname, typename, fieldname) \ typename *fieldname; \ uname(typename *x) { this->fieldname = x; } +#define TRANSPARENT_UNION #endif union prefixptr { @@ -328,7 +330,7 @@ union prefixptr { prefixtype(prefixptr, struct prefix_evpn, evp) prefixtype(prefixptr, struct prefix_fs, fs) prefixtype(prefixptr, struct prefix_rd, rd) -} __attribute__((transparent_union)); +} TRANSPARENT_UNION; union prefixconstptr { prefixtype(prefixconstptr, const struct prefix, p) @@ -337,7 +339,10 @@ union prefixconstptr { prefixtype(prefixconstptr, const struct prefix_evpn, evp) prefixtype(prefixconstptr, const struct prefix_fs, fs) prefixtype(prefixconstptr, const struct prefix_rd, rd) -} __attribute__((transparent_union)); +} TRANSPARENT_UNION; + +#undef prefixtype +#undef TRANSPARENT_UNION #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 |
