mirror of https://github.com/Icinga/icinga2.git
Fix symbol visibility issue for REGISTER_CONFIG_FRAGMENT().
This commit is contained in:
parent
4d5e924bc6
commit
fae83d2ef6
|
@ -103,7 +103,7 @@ shared_ptr<T> DynamicObjectFactory(const Dictionary::Ptr& serializedUpdate)
|
|||
}
|
||||
|
||||
#define REGISTER_TYPE_ALIAS(type, alias) \
|
||||
static icinga::RegisterTypeHelper g_RegisterDT_ ## type(alias, DynamicObjectFactory<type>);
|
||||
I2_EXPORT icinga::RegisterTypeHelper g_RegisterDT_ ## type(alias, DynamicObjectFactory<type>);
|
||||
|
||||
#define REGISTER_TYPE(type) \
|
||||
REGISTER_TYPE_ALIAS(type, #type)
|
||||
|
|
|
@ -72,9 +72,7 @@ public:
|
|||
};
|
||||
|
||||
#define REGISTER_SCRIPTFUNCTION(name, callback) \
|
||||
static icinga::RegisterFunctionHelper g_RegisterSF_ ## name(#name, callback)
|
||||
|
||||
#undef MKSYMBOL
|
||||
I2_EXPORT icinga::RegisterFunctionHelper g_RegisterSF_ ## name(#name, callback)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,6 @@ typedef int SOCKET;
|
|||
# define MAXPATHLEN PATH_MAX
|
||||
#endif /* MAXPATHLEN */
|
||||
|
||||
#if HAVE___ATTRIBUTE__
|
||||
# define I2_EXPORT __attribute__ ((visibility ("default")))
|
||||
# define I2_IMPORT __attribute__ ((visibility ("default")))
|
||||
#else /* HAVE___ATTRIBUTE__ */
|
||||
/* default visibility takes care of exported symbols if we don't have __attribute__ */
|
||||
# define I2_EXPORT
|
||||
# define I2_IMPORT
|
||||
#endif /* HAVE___ATTRIBUTE__ */
|
||||
#define I2_EXPORT
|
||||
#define I2_IMPORT
|
||||
#endif /* UNIX_H */
|
||||
|
|
|
@ -90,6 +90,4 @@ private:
|
|||
# define ASSERT(expr)
|
||||
#endif /* _DEBUG */
|
||||
|
||||
#define CONCAT(a, b) a ## b
|
||||
|
||||
#endif /* UTILITY_H */
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
};
|
||||
|
||||
#define REGISTER_CONFIG_FRAGMENT(id, name, fragment) \
|
||||
static icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## id(name, fragment)
|
||||
I2_EXPORT icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## id(name, fragment)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ int main(int argc, char **argv)
|
|||
int cols;
|
||||
FILE *infp, *outfp;
|
||||
int i;
|
||||
char id[32];
|
||||
|
||||
if (argc < 3) {
|
||||
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
|
||||
|
@ -67,11 +68,10 @@ int main(int argc, char **argv)
|
|||
cols++;
|
||||
}
|
||||
|
||||
char id[32];
|
||||
strncpy(id, argv[1], sizeof(id));
|
||||
id[sizeof(id) - 1] = '\0';
|
||||
|
||||
for (i = 0; i < sizeof(id) - 1; i++) {
|
||||
for (i = 0; id[i]; i++) {
|
||||
if ((id[i] < 'a' || id[i] > 'z') && (id[i] < 'A' || id[i] > 'Z'))
|
||||
id[i] = '_';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue