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) \
|
#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) \
|
#define REGISTER_TYPE(type) \
|
||||||
REGISTER_TYPE_ALIAS(type, #type)
|
REGISTER_TYPE_ALIAS(type, #type)
|
||||||
|
|
|
@ -72,9 +72,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REGISTER_SCRIPTFUNCTION(name, callback) \
|
#define REGISTER_SCRIPTFUNCTION(name, callback) \
|
||||||
static icinga::RegisterFunctionHelper g_RegisterSF_ ## name(#name, callback)
|
I2_EXPORT icinga::RegisterFunctionHelper g_RegisterSF_ ## name(#name, callback)
|
||||||
|
|
||||||
#undef MKSYMBOL
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,6 @@ typedef int SOCKET;
|
||||||
# define MAXPATHLEN PATH_MAX
|
# define MAXPATHLEN PATH_MAX
|
||||||
#endif /* MAXPATHLEN */
|
#endif /* MAXPATHLEN */
|
||||||
|
|
||||||
#if HAVE___ATTRIBUTE__
|
#define I2_EXPORT
|
||||||
# define I2_EXPORT __attribute__ ((visibility ("default")))
|
#define I2_IMPORT
|
||||||
# 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__ */
|
|
||||||
#endif /* UNIX_H */
|
#endif /* UNIX_H */
|
||||||
|
|
|
@ -90,6 +90,4 @@ private:
|
||||||
# define ASSERT(expr)
|
# define ASSERT(expr)
|
||||||
#endif /* _DEBUG */
|
#endif /* _DEBUG */
|
||||||
|
|
||||||
#define CONCAT(a, b) a ## b
|
|
||||||
|
|
||||||
#endif /* UTILITY_H */
|
#endif /* UTILITY_H */
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REGISTER_CONFIG_FRAGMENT(id, name, fragment) \
|
#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;
|
int cols;
|
||||||
FILE *infp, *outfp;
|
FILE *infp, *outfp;
|
||||||
int i;
|
int i;
|
||||||
|
char id[32];
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
|
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
|
||||||
|
@ -67,11 +68,10 @@ int main(int argc, char **argv)
|
||||||
cols++;
|
cols++;
|
||||||
}
|
}
|
||||||
|
|
||||||
char id[32];
|
|
||||||
strncpy(id, argv[1], sizeof(id));
|
strncpy(id, argv[1], sizeof(id));
|
||||||
id[sizeof(id) - 1] = '\0';
|
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'))
|
if ((id[i] < 'a' || id[i] > 'z') && (id[i] < 'A' || id[i] > 'Z'))
|
||||||
id[i] = '_';
|
id[i] = '_';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue