summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-08-09 00:27:35 +0200
committerGitHub <noreply@github.com>2017-08-09 00:27:35 +0200
commit248285d5a4be058b6abb40a9e31fff189bd2f598 (patch)
tree0b4035b6267ffe9dc107add4a5ea859eb587cae3
parent537b2bb3510f52eb9ccdee4f98e6061b5878bff0 (diff)
parenta1a9ce04eeefb5ff00b2101732ef3f5e02d36093 (diff)
downloadhercules-248285d5a4be058b6abb40a9e31fff189bd2f598.tar.gz
hercules-248285d5a4be058b6abb40a9e31fff189bd2f598.tar.bz2
hercules-248285d5a4be058b6abb40a9e31fff189bd2f598.tar.xz
hercules-248285d5a4be058b6abb40a9e31fff189bd2f598.zip
Merge pull request #1816 from 4144/travis
Add into travis check for hpm update
-rw-r--r--.travis.yml40
-rw-r--r--src/common/cbasetypes.h7
-rw-r--r--src/plugins/HPMHooking.c6
-rwxr-xr-xtools/ci/travis.sh5
4 files changed, 55 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index 28f4387a6..a5430dbce 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,9 +4,6 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- packages:
- - gcc-5
- - gcc-6
install:
- ./tools/ci/travis.sh getplugins || true
@@ -18,6 +15,7 @@ before_script:
- mysql -u root -e "SET PASSWORD FOR 'travis'@'localhost' = PASSWORD('travis');"
script:
+ - if [[ ! -z "${HPM}" ]]; then ./tools/ci/travis.sh buildhpm $CONFIGURE_FLAGS; fi
- ./tools/ci/travis.sh build $CONFIGURE_FLAGS
- ./tools/ci/travis.sh test ragnarok travis travis
@@ -31,6 +29,18 @@ matrix:
exclude:
- env: ignore=this
include:
+ - compiler: gcc
+ env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-buildbot" HPM="1"
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - gcc-6
+ - doxygen
+ - libxml-simple-perl
+ - libxml-sax-perl
+ - libxml-parser-perl
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-buildbot"
- compiler: clang
@@ -41,12 +51,36 @@ matrix:
env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot"
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --enable-Werror --enable-buildbot"
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - gcc-5
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --disable-renewal --enable-Werror --enable-buildbot"
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - gcc-5
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-buildbot"
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - gcc-6
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --disable-renewal --enable-Werror --enable-buildbot"
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - gcc-6
notifications:
email: false
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 2c36c23bc..5be2d62e4 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -306,6 +306,13 @@ typedef uintptr_t uintptr;
#define PRAGMA_GCC46(str)
#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+// Pragma macro only enabled on gcc >= 5 or clang - borrowed from Mana Plus
+#if defined(__GNUC__) && (GCC_VERSION >= 50000)
+#define PRAGMA_GCC5(str) _Pragma(#str)
+#else // ! defined(__GNUC__) && (GCC_VERSION >= 50000)
+#define PRAGMA_GCC5(str)
+#endif // ! defined(__GNUC__) && (GCC_VERSION >= 50000)
+
// fallthrough attribute only enabled on gcc >= 7.0
#if defined(__GNUC__) && (GCC_VERSION >= 70000)
#define FALLTHROUGH __attribute__ ((fallthrough));
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index a5354211d..6d6184402 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.c
@@ -26,6 +26,8 @@
#include "common/mmo.h"
#include "common/socket.h"
+PRAGMA_GCC5(GCC diagnostic push)
+PRAGMA_GCC5(GCC diagnostic ignored "-Wdiscarded-qualifiers")
#if defined (HPMHOOKING_LOGIN)
#define HPM_SERVER_TYPE SERVER_TYPE_LOGIN
#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_login.HPMHooksCore.inc"
@@ -109,6 +111,7 @@
#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking.sources.inc"
#error HPMHooking plugin needs to be compiled for a specific server type. Please make sure your Makefiles are up to date.
#endif
+PRAGMA_GCC5(GCC diagnostic pop)
#include "common/conf.h"
#include "common/console.h"
#include "common/db.h"
@@ -212,7 +215,10 @@ HPExport bool HPM_Plugin_AddHook(enum HPluginHookType type, const char *target,
return false;
}
+PRAGMA_GCC5(GCC diagnostic push)
+PRAGMA_GCC5(GCC diagnostic ignored "-Wdiscarded-qualifiers")
#include HPM_HOOKS_INCLUDE
+PRAGMA_GCC5(GCC diagnostic pop)
void HPM_HP_final(void) {
int i, len = HPMHooks.data.total * 2;
diff --git a/tools/ci/travis.sh b/tools/ci/travis.sh
index 4ba7e94b5..633248a1a 100755
--- a/tools/ci/travis.sh
+++ b/tools/ci/travis.sh
@@ -125,6 +125,11 @@ case "$MODE" in
make plugin.script_mapquit -j3 || aborterror "Build failed."
make test || aborterror "Build failed."
;;
+ buildhpm)
+ ./configure $@ || (cat config.log && aborterror "Configure error, aborting build.")
+ cd tools/HPMHookGen
+ make
+ ;;
test)
cat > conf/travis_sql_connection.conf << EOF
sql_connection: {