summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-14 17:25:30 +0200
committerHaru <haru@dotalux.com>2015-08-14 17:25:30 +0200
commit7b4cdcef184362fecc0bba76025affd05f020989 (patch)
treedf838de2c6c68115bfdd1f076b1dfed1b58462d3
parenta699dbcc5baf12edd35562518802655835a4e991 (diff)
downloadhercules-7b4cdcef184362fecc0bba76025affd05f020989.tar.gz
hercules-7b4cdcef184362fecc0bba76025affd05f020989.tar.bz2
hercules-7b4cdcef184362fecc0bba76025affd05f020989.tar.xz
hercules-7b4cdcef184362fecc0bba76025affd05f020989.zip
FIXUP (allow compilation of plugins with multiple compilation units)
-rw-r--r--src/common/hercules.h5
-rw-r--r--tools/HPMHookGen/HPMDataCheckGen.pl4
-rwxr-xr-xtools/HPMHookGen/HPMHookGen.pl25
3 files changed, 25 insertions, 9 deletions
diff --git a/src/common/hercules.h b/src/common/hercules.h
index d785c89e2..678577690 100644
--- a/src/common/hercules.h
+++ b/src/common/hercules.h
@@ -14,10 +14,9 @@
#define HPExport __attribute__((visibility("default")))
#endif
-#ifdef HERCULES_CORE
#define HPShared extern
-#else // !HERCULES_CORE
-#define HPShared HPExport
+
+#ifndef HERCULES_CORE
#include "common/HPMi.h"
#endif // HERCULES_CORE
diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl
index 66ce7a4f6..e658f8be8 100644
--- a/tools/HPMHookGen/HPMDataCheckGen.pl
+++ b/tools/HPMHookGen/HPMDataCheckGen.pl
@@ -59,11 +59,7 @@ print FH <<"EOF";
#define HPM_DATA_CHECK_H
#if !defined(HPMHOOKGEN)
-HPExport const char *HPM_shared_symbols(int server_type)
-{
#include "common/HPMSymbols.inc.h"
- return NULL;
-}
#endif // ! HPMHOOKGEN
#ifdef HPM_SYMBOL
#undef HPM_SYMBOL
diff --git a/tools/HPMHookGen/HPMHookGen.pl b/tools/HPMHookGen/HPMHookGen.pl
index 85df62a0f..d1b96efb3 100755
--- a/tools/HPMHookGen/HPMHookGen.pl
+++ b/tools/HPMHookGen/HPMHookGen.pl
@@ -443,12 +443,12 @@ foreach my $servertype (keys %keys) {
my ($maxlen, $idx) = (0, 0);
my $fname;
-
+
if ($servertype eq 'all') {
$fname = "../../src/common/HPMSymbols.inc.h";
open(FH, ">", $fname)
or die "cannot open > $fname: $!";
-
+
print FH <<"EOF";
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
@@ -456,6 +456,22 @@ foreach my $servertype (keys %keys) {
// NOTE: This file was auto-generated and should never be manually edited,
// as it will get overwritten.
+#if !defined(HERCULES_CORE)
+EOF
+
+ foreach my $key (@$keysref) {
+ print FH <<"EOF";
+#ifdef $fileguards{$key}->{guard} /* $key */
+struct $key2original{$key} *$key;
+#endif // $fileguards{$key}->{guard}
+EOF
+ }
+
+ print FH <<"EOF";
+#endif // ! HERCULES_CORE
+
+HPExport const char *HPM_shared_symbols(int server_type)
+{
EOF
foreach my $key (@$keysref) {
@@ -465,6 +481,11 @@ if ((server_type&($fileguards{$key}->{type})) && !HPM_SYMBOL("$exportsymbols{$ke
#endif // $fileguards{$key}->{guard}
EOF
}
+
+ print FH <<"EOF";
+ return NULL;
+}
+EOF
close FH;
next;
}