From 878d19ba32f21b1ff5a43be24362fa9f12c9a7f7 Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Tue, 25 Apr 2006 13:50:54 +0000 Subject: [PATCH] work around solaris 8-isms git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@765 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/README-recursor | 7 +++++++ pdns/dnswriter.hh | 2 ++ pdns/mtasker.cc | 6 +++++- pdns/rcpgenerator.hh | 2 ++ pdns/rec_channel.hh | 2 ++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pdns/README-recursor b/pdns/README-recursor index 0a9fcc3f2..a8ea8a8a0 100644 --- a/pdns/README-recursor +++ b/pdns/README-recursor @@ -37,6 +37,13 @@ $ CXXFLAGS=-I./boost_1_33_1/ make all 5) (g)make install +PLATFORM SPECIFIC NOTES +----------------------- +When compiling on Solaris, use: +$ CPPFLAGS=-DSOLARIS8 ... gmake + +where ... stands for any possible CXXFLAGS or PROFILEFLAGS, see below. + PERFORMANCE ----------- diff --git a/pdns/dnswriter.hh b/pdns/dnswriter.hh index d4f879626..25ff8c25b 100644 --- a/pdns/dnswriter.hh +++ b/pdns/dnswriter.hh @@ -4,7 +4,9 @@ #include #include #include +#ifndef SOLARIS8 #include +#endif #include #include diff --git a/pdns/mtasker.cc b/pdns/mtasker.cc index 67ecfa364..d795b1724 100644 --- a/pdns/mtasker.cc +++ b/pdns/mtasker.cc @@ -243,7 +243,7 @@ templatevoid MTasker::makeThread(tfunc_t *start, uc->uc_stack.ss_sp = new char[d_stacksize]; uc->uc_stack.ss_size = d_stacksize; -#ifdef SOLARIS +#ifdef SOLARIS8 uc->uc_stack.ss_sp = (void*)(((char*)uc->uc_stack.ss_sp)+d_stacksize); makecontext (uc,(void (*)(...))threadWrapper, 5, this, start, d_maxtid, val); #else @@ -277,7 +277,11 @@ templatebool MTasker::schedule() return true; } if(!d_zombiesQueue.empty()) { +#ifdef SOLARIS8 + delete[] (((char *)d_threads[d_zombiesQueue.front()]->uc_stack.ss_sp)-d_stacksize); +#else delete[] (char *)d_threads[d_zombiesQueue.front()]->uc_stack.ss_sp; +#endif delete d_threads[d_zombiesQueue.front()]; d_threads.erase(d_zombiesQueue.front()); d_zombiesQueue.pop(); diff --git a/pdns/rcpgenerator.hh b/pdns/rcpgenerator.hh index 1fcae8895..7122f208f 100644 --- a/pdns/rcpgenerator.hh +++ b/pdns/rcpgenerator.hh @@ -22,7 +22,9 @@ #include #include +#ifndef SOLARIS8 #include +#endif using namespace std; diff --git a/pdns/rec_channel.hh b/pdns/rec_channel.hh index 67a3ebf2d..bab500a61 100644 --- a/pdns/rec_channel.hh +++ b/pdns/rec_channel.hh @@ -2,7 +2,9 @@ #define PDNS_REC_CHANNEL #include #include +#ifndef SOLARIS8 #include +#endif #include -- 2.49.0