diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..debc7ce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: c++ +jobs: + include: + - compiler: gcc + os: linux + dist: bionic + - compiler: clang + os: linux + dist: bionic + - compiler: gcc + os: linux + dist: xenial + - compiler: clang + os: linux + dist: xenial + +addons: + apt: + packages: + - libspf2-dev + homebrew: + packages: + - gettext + - openssl + +script: + - ./bootstrap + - ./configure + - make install prefix=$PWD/install-dir + - find $PWD/install-dir diff --git a/src/Makefile.am b/src/Makefile.am index 08a9a91..d2ace42 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ INCLUDES = $(OpenSSL_CFLAGS) $(SQLite3_CFLAGS) LIBS = $(OpenSSL_LIBS) $(SQLite3_LIBS) -CXXFLAGS += -Wall -ansi -pedantic -Wshadow -pthread -Werror --std=c++11 +CXXFLAGS += -Wall -pedantic -Wshadow -pthread -Werror --std=c++11 bin_PROGRAMS = hermes nodist_hermes_SOURCES = Configfile.cpp diff --git a/src/hermes.cpp b/src/hermes.cpp index 523f5d3..6b4ae2c 100644 --- a/src/hermes.cpp +++ b/src/hermes.cpp @@ -64,13 +64,13 @@ __thread unsigned long connection_id; list children; -#ifdef HAVE_SSL -pthread_mutex_t ssl_locks[CRYPTO_num_locks()]={PTHREAD_MUTEX_INITIALIZER}; +#if defined(HAVE_SSL) && OPENSSL_VERSION_NUMBER < 0x10100000L +pthread_mutex_t ssl_locks[CRYPTO_NUM_LOCKS]={PTHREAD_MUTEX_INITIALIZER}; void ssl_locking_function(int mode,int n,const char *file,int line) { - if(n>CRYPTO_num_locks()) - throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_num_locks()("+Utils::inttostr(CRYPTO_num_locks())+")"),__FILE__,__LINE__); + if(n>CRYPTO_NUM_LOCKS) + throw Exception(_("Error, "+Utils::inttostr(n)+" is bigger than CRYPTO_NUM_LOCKS()("+Utils::inttostr(CRYPTO_NUM_LOCKS)+")"),__FILE__,__LINE__); if(mode&CRYPTO_LOCK) pthread_mutex_lock(&ssl_locks[n]); else @@ -95,7 +95,7 @@ main } */ - #ifdef HAVE_SSL + #if defined(HAVE_SSL) && OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_set_locking_callback(ssl_locking_function); #ifndef WIN32 //getpid() returns different values for threads on windows, therefor this is not needed CRYPTO_set_id_callback(pthread_self);