diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-28 00:55:42 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-28 00:55:42 +0000 |
commit | d5e36aa2b2ca26fe689ae9e29c74b3565dd018c7 (patch) | |
tree | 8bc1def53ab7817bfaeb183fed7872583a70acbd | |
parent | 3900997a0971efc350400f62bfcac8c29aa65885 (diff) |
Fix warnings from BSD build and work around the failures of BSD make
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11771 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/extensible.h | 11 | ||||
-rwxr-xr-x | make/calcdep.pl | 2 | ||||
-rwxr-xr-x | make/unit-cc.pl | 10 | ||||
-rw-r--r-- | src/base.cpp | 20 |
4 files changed, 36 insertions, 7 deletions
diff --git a/include/extensible.h b/include/extensible.h index d3d22a97e..10e96d875 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -21,6 +21,7 @@ class CoreExport ExtensionItem const std::string key; Module* const owner; ExtensionItem(const std::string& key, Module* owner); + virtual ~ExtensionItem(); /** Serialize this item into a string * * @param format The format to serialize to @@ -83,7 +84,7 @@ class CoreExport Extensible : public classbase static bool Register(ExtensionItem* item); static std::vector<ExtensionItem*> BeginUnregister(Module* module); void doUnhookExtensions(const std::vector<ExtensionItem*>& toRemove); - + // Friend access for the protected getter/setter friend class ExtensionItem; }; @@ -93,6 +94,7 @@ class CoreExport LocalExtItem : public ExtensionItem { public: LocalExtItem(const std::string& key, Module* owner); + virtual ~LocalExtItem(); virtual std::string serialize(SerializeFormat format, const Extensible* container, void* item); virtual void unserialize(SerializeFormat format, Extensible* container, const std::string& value); virtual void free(void* item) = 0; @@ -106,6 +108,10 @@ class CoreExport SimpleExtItem : public LocalExtItem { } + virtual ~SimpleExtItem() + { + } + inline T* get(const Extensible* container) { return static_cast<T*>(get_raw(container)); @@ -151,6 +157,7 @@ class CoreExport LocalStringExt : public SimpleExtItem<std::string> { public: LocalStringExt(const std::string& key, Module* owner); + virtual ~LocalStringExt(); std::string serialize(SerializeFormat format, const Extensible* container, void* item); }; @@ -158,6 +165,7 @@ class CoreExport LocalIntExt : public LocalExtItem { public: LocalIntExt(const std::string& key, Module* owner); + virtual ~LocalIntExt(); std::string serialize(SerializeFormat format, const Extensible* container, void* item); intptr_t get(const Extensible* container); intptr_t set(Extensible* container, intptr_t value); @@ -168,6 +176,7 @@ class CoreExport StringExtItem : public ExtensionItem { public: StringExtItem(const std::string& key, Module* owner); + virtual ~StringExtItem(); std::string* get(const Extensible* container); std::string serialize(SerializeFormat format, const Extensible* container, void* item); void unserialize(SerializeFormat format, Extensible* container, const std::string& value); diff --git a/make/calcdep.pl b/make/calcdep.pl index 7d424f4e3..1c5baeded 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -138,7 +138,7 @@ sub dep_cpp($$) { gendep $file; print MAKE "$out: $file $f2dep{$file}\n"; - print MAKE "\t@\$(SOURCEPATH)/make/unit-cc.pl \$(VERBOSE) \$< \$\@\n"; + print MAKE "\t@\$(SOURCEPATH)/make/unit-cc.pl \$(VERBOSE) \$\@ \$< \$>\n"; } sub dep_dir($) { diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 75c206d8c..d4786b8fe 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -4,16 +4,16 @@ use warnings; BEGIN { push @INC, $ENV{SOURCEPATH}; } use make::configure; -my $file = shift; +my $out = shift; my $verbose; -if ($file =~ /^-/) { - $_ = $file; - $file = shift; +if ($out =~ /^-/) { + $_ = $out; + $out = shift; $verbose = /v/; } -my $out = shift; +my $file = shift; my $cflags = $ENV{CXXFLAGS}; $cflags =~ s/ -pedantic// if nopedantic($file); diff --git a/src/base.cpp b/src/base.cpp index 2b022688d..76e469482 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -91,6 +91,10 @@ ExtensionItem::ExtensionItem(const std::string& Key, Module* mod) : key(Key), ow { } +ExtensionItem::~ExtensionItem() +{ +} + void* ExtensionItem::get_raw(const Extensible* container) { ExtensibleStore::const_iterator i = container->extensions.find(key); @@ -175,6 +179,10 @@ LocalExtItem::LocalExtItem(const std::string& Key, Module* mod) : ExtensionItem( { } +LocalExtItem::~LocalExtItem() +{ +} + std::string LocalExtItem::serialize(SerializeFormat format, const Extensible* container, void* item) { return ""; @@ -187,6 +195,10 @@ void LocalExtItem::unserialize(SerializeFormat format, Extensible* container, co LocalStringExt::LocalStringExt(const std::string& Key, Module* Owner) : SimpleExtItem<std::string>(Key, Owner) { } +LocalStringExt::~LocalStringExt() +{ +} + std::string LocalStringExt::serialize(SerializeFormat format, const Extensible* container, void* item) { if (item && format == FORMAT_USER) @@ -198,6 +210,10 @@ LocalIntExt::LocalIntExt(const std::string& Key, Module* mod) : LocalExtItem(Key { } +LocalIntExt::~LocalIntExt() +{ +} + std::string LocalIntExt::serialize(SerializeFormat format, const Extensible* container, void* item) { if (format != FORMAT_USER) @@ -226,6 +242,10 @@ StringExtItem::StringExtItem(const std::string& Key, Module* mod) : ExtensionIte { } +StringExtItem::~StringExtItem() +{ +} + std::string* StringExtItem::get(const Extensible* container) { return static_cast<std::string*>(get_raw(container)); |