diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-11-28 08:19:59 -0300 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-11-28 08:21:25 -0300 | 
| commit | a0823246493f72cf87a04595b219cf34dd976ad4 (patch) | |
| tree | 3953709589b1f83868016f29069f7d4094f52569 /lib/prefix.h | |
| parent | d15c84fa223bb32500912af1d05c8a701a643e15 (diff) | |
lib: handle visual studio code C/C++ extension
Add some `pragma`s to handle errors that the C/C++ extension is not able
to understand.
Move `TRANSPARENT_UNION` to `lib/compiler.h` for consistency.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.h')
| -rw-r--r-- | lib/prefix.h | 16 | 
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index c67656cfd1..7de8d7903e 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -301,22 +301,6 @@ struct prefix_sg {  	struct in_addr grp;  }; -/* helper to get type safety/avoid casts on calls - * (w/o this, functions accepting all prefix types need casts on the caller - * side, which strips type safety since the cast will accept any pointer - * type.) - */ -#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 {  	prefixtype(prefixptr, struct prefix,      p)  	prefixtype(prefixptr, struct prefix_ipv4, p4)  | 
