mirror of https://github.com/Icinga/icinga2.git
parent
b2a1541394
commit
9f425cdcaf
|
@ -690,3 +690,6 @@ ConfigObject::Ptr ConfigObject::GetZone(void) const
|
|||
{
|
||||
return m_Zone;
|
||||
}
|
||||
|
||||
NameComposer::~NameComposer(void)
|
||||
{ }
|
||||
|
|
|
@ -31,8 +31,11 @@ enum HAMode
|
|||
HARunEverywhere
|
||||
};
|
||||
|
||||
class NameComposer {
|
||||
class I2_BASE_API NameComposer
|
||||
{
|
||||
public:
|
||||
virtual ~NameComposer(void);
|
||||
|
||||
virtual String MakeName(const String& shortName, const Object::Ptr& context) const = 0;
|
||||
virtual Dictionary::Ptr ParseName(const String& name) const = 0;
|
||||
};
|
||||
|
|
|
@ -132,7 +132,7 @@ protected:
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
class TypeImpl
|
||||
class I2_BASE_API TypeImpl
|
||||
{
|
||||
};
|
||||
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
|
||||
#ifndef _WIN32
|
||||
# define I2_EXPORT __attribute__ ((visibility("default")))
|
||||
# define I2_IMPORT
|
||||
# define I2_IMPORT __attribute__ ((visibility("default")))
|
||||
#else /* _WIN32 */
|
||||
# define I2_EXPORT __declspec(dllexport)
|
||||
# define I2_IMPORT __declspec(dllimport)
|
||||
# define I2_HIDDEN
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#define TOKENPASTE(x, y) x ## y
|
||||
|
|
|
@ -109,6 +109,20 @@ void ClassCompiler::HandleCode(const std::string& code, const ClassDebugInfo&)
|
|||
void ClassCompiler::HandleLibrary(const std::string& library, const ClassDebugInfo& locp)
|
||||
{
|
||||
m_Library = library;
|
||||
|
||||
std::string libName = m_Library;
|
||||
std::locale locale;
|
||||
|
||||
for (std::string::size_type i = 0; i < libName.size(); i++)
|
||||
libName[i] = std::toupper(libName[i], locale);
|
||||
|
||||
m_Header << "#ifndef I2_" << libName << "_API" << std::endl
|
||||
<< "# ifdef I2_" << libName << "_BUILD" << std::endl
|
||||
<< "# define I2_" << libName << "_API I2_EXPORT" << std::endl
|
||||
<< "# else /* I2_" << libName << "_BUILD */" << std::endl
|
||||
<< "# define I2_" << libName << "_API I2_IMPORT" << std::endl
|
||||
<< "# endif /* I2_" << libName << "_BUILD */" << std::endl
|
||||
<< "#endif /* I2_" << libName << "_API */" << std::endl << std::endl;
|
||||
}
|
||||
|
||||
unsigned long ClassCompiler::SDBM(const std::string& str, size_t len = std::string::npos)
|
||||
|
@ -204,14 +218,6 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||
for (std::string::size_type i = 0; i < libName.size(); i++)
|
||||
libName[i] = std::toupper(libName[i], locale);
|
||||
|
||||
m_Header << "#ifndef I2_" << libName << "_API" << std::endl
|
||||
<< "# ifdef I2_" << libName << "_BUILD" << std::endl
|
||||
<< "# define I2_" << libName << "_API I2_EXPORT" << std::endl
|
||||
<< "# else /* I2_" << libName << "_BUILD */" << std::endl
|
||||
<< "# define I2_" << libName << "_API I2_IMPORT" << std::endl
|
||||
<< "# endif /* I2_" << libName << "_BUILD */" << std::endl
|
||||
<< "#endif /* I2_" << libName << "_API */" << std::endl << std::endl;
|
||||
|
||||
apiMacro = "I2_" + libName + "_API ";
|
||||
}
|
||||
|
||||
|
@ -233,7 +239,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||
|
||||
/* TypeImpl */
|
||||
m_Header << "template<>" << std::endl
|
||||
<< "class TypeImpl<" << klass.Name << ">"
|
||||
<< "class " << apiMacro << "TypeImpl<" << klass.Name << ">"
|
||||
<< " : public Type";
|
||||
|
||||
if (!klass.TypeBase.empty())
|
||||
|
|
Loading…
Reference in New Issue