Pothos  0.4.1-gb758ed46
The Pothos dataflow programming software suite
Static.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
14 
28 #if defined(__clang__)
29 #define POTHOS_STATIC_FIXTURE_DECL static
30 #elif defined(_MSC_VER)
31 #define POTHOS_STATIC_FIXTURE_DECL inline
32 #elif defined(__GNUC__)
33 #define POTHOS_STATIC_FIXTURE_DECL static inline
34 #else
35 #define POTHOS_STATIC_FIXTURE_DECL
36 #endif
37 
46 #define pothos_static_block(name) \
47  POTHOS_STATIC_FIXTURE_DECL void name ## StaticFixtureInit__(void); \
48  template <Pothos::Detail::InitFcn init> \
49  struct name ## StaticFixture__ \
50  { \
51  name ## StaticFixture__(void) \
52  { \
53  Pothos::Detail::safeInit(POTHOS_ABI_VERSION, #name, init); \
54  } \
55  }; \
56  static name ## StaticFixture__<&name ## StaticFixtureInit__> name ## StaticFixtureInstance__; \
57  POTHOS_STATIC_FIXTURE_DECL void name ## StaticFixtureInit__(void)
58 
59 namespace Pothos {
60 namespace Detail {
61 
62 typedef void (*InitFcn)(void);
63 
64 POTHOS_API void safeInit(const std::string &clientAbi, const std::string &name, InitFcn init);
65 
66 } //namespace Detail
67 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
Definition: Testing.hpp:134
POTHOS_API void init(void)