diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-02-13 12:47:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-13 12:47:23 -0500 |
| commit | cfef27e56ef3246a261ee0bf2810a46c08eebf8f (patch) | |
| tree | ac66ba3d1f7a037ad51f21bd54a236d5388f5916 /lib/module.h | |
| parent | 01490ba25da576ec0a72c896559ebc6fa71484be (diff) | |
| parent | 8ed561e1f13d0afb019a7963238bdd43ad017bec (diff) | |
Merge pull request #3622 from mjstapp/fix_cpp_compile
libs, daemons: changes to permit c++ compilation
Diffstat (limited to 'lib/module.h')
| -rw-r--r-- | lib/module.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/module.h b/lib/module.h index 68ed959270..c5f96db85b 100644 --- a/lib/module.h +++ b/lib/module.h @@ -20,6 +20,10 @@ #include <stdint.h> #include <stdbool.h> +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(__GNUC__) #error module code needs GCC visibility extensions #elif __GNUC__ < 4 @@ -78,9 +82,10 @@ extern union _frrmod_runtime_u _frrmod_this_module; #define FRR_COREMOD_SETUP(...) \ static const struct frrmod_info _frrmod_info = {__VA_ARGS__}; \ - DSO_LOCAL union _frrmod_runtime_u _frrmod_this_module = { \ - .r.info = &_frrmod_info, \ - }; + DSO_LOCAL union _frrmod_runtime_u _frrmod_this_module = {{ \ + NULL, \ + &_frrmod_info, \ + }}; #define FRR_MODULE_SETUP(...) \ FRR_COREMOD_SETUP(__VA_ARGS__) \ DSO_SELF struct frrmod_runtime *frr_module = &_frrmod_this_module.r; @@ -95,4 +100,8 @@ extern struct frrmod_runtime *frrmod_load(const char *spec, const char *dir, extern void frrmod_unload(struct frrmod_runtime *module); #endif +#ifdef __cplusplus +} +#endif + #endif /* _FRR_MODULE_H */ |
