diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/options.mk | 4 | ||||
-rw-r--r-- | cpp/src/qpid/apr/APRBase.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/apr/APRPool.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/apr/APRSocket.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/apr/LFProcessor.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/apr/LFSessionContext.h | 6 | ||||
-rw-r--r-- | cpp/src/qpid/posix/EpollEventChannel.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/posix/check.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Module.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Monitor.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Socket.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Thread.h | 4 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Time.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/signal.h | 2 | ||||
-rw-r--r-- | cpp/test/unit/qpid/posix/EpollEventChannelTest.cpp | 71 |
15 files changed, 21 insertions, 90 deletions
diff --git a/cpp/options.mk b/cpp/options.mk index f624a397b3..351f4bdefd 100644 --- a/cpp/options.mk +++ b/cpp/options.mk @@ -36,12 +36,12 @@ endif ifdef USE_APR PLATFORM := apr IGNORE := posix -CXXFLAGS := $(CXXFLAGS) -DUSE_APR -I/usr/local/apr/include +CXXFLAGS := $(CXXFLAGS) -DUSE_APR -I$(shell apr-1-config --includedir) LDFLAGS := $(LDFLAGS) -L/usr/local/apr/lib -lapr-1 else PLATFORM := posix IGNORE := apr -LDFLAGS := $(LDFLAGS) -lpthread -lrt +LDFLAGS := $(LDFLAGS) -lpthread -lrt -ldl endif ## Build directories. diff --git a/cpp/src/qpid/apr/APRBase.h b/cpp/src/qpid/apr/APRBase.h index 929d421aeb..d1b3e21b91 100644 --- a/cpp/src/qpid/apr/APRBase.h +++ b/cpp/src/qpid/apr/APRBase.h @@ -22,8 +22,8 @@ #define _APRBase_ #include <string> -#include <apr-1/apr_thread_mutex.h> -#include <apr-1/apr_errno.h> +#include <apr_thread_mutex.h> +#include <apr_errno.h> namespace qpid { namespace sys { diff --git a/cpp/src/qpid/apr/APRPool.h b/cpp/src/qpid/apr/APRPool.h index b52db3739f..da7661fcfa 100644 --- a/cpp/src/qpid/apr/APRPool.h +++ b/cpp/src/qpid/apr/APRPool.h @@ -22,7 +22,7 @@ * */ #include <boost/noncopyable.hpp> -#include <apr-1/apr_pools.h> +#include <apr_pools.h> namespace qpid { namespace sys { diff --git a/cpp/src/qpid/apr/APRSocket.h b/cpp/src/qpid/apr/APRSocket.h index 591df2daaa..803740f97e 100644 --- a/cpp/src/qpid/apr/APRSocket.h +++ b/cpp/src/qpid/apr/APRSocket.h @@ -21,7 +21,7 @@ #ifndef _APRSocket_ #define _APRSocket_ -#include <apr-1/apr_network_io.h> +#include <apr_network_io.h> #include <qpid/framing/Buffer.h> namespace qpid { diff --git a/cpp/src/qpid/apr/LFProcessor.h b/cpp/src/qpid/apr/LFProcessor.h index 63771f9ab6..1d1162d034 100644 --- a/cpp/src/qpid/apr/LFProcessor.h +++ b/cpp/src/qpid/apr/LFProcessor.h @@ -21,7 +21,7 @@ #ifndef _LFProcessor_ #define _LFProcessor_ -#include <apr-1/apr_poll.h> +#include <apr_poll.h> #include <iostream> #include <vector> #include <qpid/sys/Monitor.h> diff --git a/cpp/src/qpid/apr/LFSessionContext.h b/cpp/src/qpid/apr/LFSessionContext.h index 031aad5e5f..7060c971a5 100644 --- a/cpp/src/qpid/apr/LFSessionContext.h +++ b/cpp/src/qpid/apr/LFSessionContext.h @@ -23,9 +23,9 @@ #include <queue> -#include <apr-1/apr_network_io.h> -#include <apr-1/apr_poll.h> -#include <apr-1/apr_time.h> +#include <apr_network_io.h> +#include <apr_poll.h> +#include <apr_time.h> #include <qpid/framing/AMQFrame.h> #include <qpid/framing/Buffer.h> diff --git a/cpp/src/qpid/posix/EpollEventChannel.cpp b/cpp/src/qpid/posix/EpollEventChannel.cpp index 1418507542..7dce4bc58c 100644 --- a/cpp/src/qpid/posix/EpollEventChannel.cpp +++ b/cpp/src/qpid/posix/EpollEventChannel.cpp @@ -35,6 +35,8 @@ EpollEventChannel::EpollEventChannel() epollFd = epoll_create(estimatedFdsForEpoll); } +EpollEventChannel::~EpollEventChannel() { } + void EpollEventChannel::post(ReadEvent& /*event*/) { diff --git a/cpp/src/qpid/posix/check.cpp b/cpp/src/qpid/posix/check.cpp index 3470906639..2ef52f68b7 100644 --- a/cpp/src/qpid/posix/check.cpp +++ b/cpp/src/qpid/posix/check.cpp @@ -25,7 +25,7 @@ namespace qpid { namespace sys { -std::string strError() { +std::string errnoToString() { char buf[512]; return strerror_r(errno, buf, sizeof(buf)); } diff --git a/cpp/src/qpid/sys/Module.h b/cpp/src/qpid/sys/Module.h index 3093eef074..db791666e0 100644 --- a/cpp/src/qpid/sys/Module.h +++ b/cpp/src/qpid/sys/Module.h @@ -28,7 +28,7 @@ namespace qpid { namespace sys { #if USE_APR -#include <apr-1/apr_dso.h> +#include <apr_dso.h> typedef apr_dso_handle_t* dso_handle_t; #else typedef void* dso_handle_t; diff --git a/cpp/src/qpid/sys/Monitor.h b/cpp/src/qpid/sys/Monitor.h index a3abe37748..59e1e74b57 100644 --- a/cpp/src/qpid/sys/Monitor.h +++ b/cpp/src/qpid/sys/Monitor.h @@ -25,8 +25,8 @@ #include <boost/noncopyable.hpp> #ifdef USE_APR -# include <apr-1/apr_thread_mutex.h> -# include <apr-1/apr_thread_cond.h> +# include <apr_thread_mutex.h> +# include <apr_thread_cond.h> # include <qpid/apr/APRBase.h> # include <qpid/apr/APRPool.h> #else diff --git a/cpp/src/qpid/sys/Socket.h b/cpp/src/qpid/sys/Socket.h index 0b898bb999..cf757e7a27 100644 --- a/cpp/src/qpid/sys/Socket.h +++ b/cpp/src/qpid/sys/Socket.h @@ -25,7 +25,7 @@ #include <string> #ifdef USE_APR -# include <apr-1/apr_network_io.h> +# include <apr_network_io.h> #endif namespace qpid { diff --git a/cpp/src/qpid/sys/Thread.h b/cpp/src/qpid/sys/Thread.h index 79dfc184e0..2aad7c24d7 100644 --- a/cpp/src/qpid/sys/Thread.h +++ b/cpp/src/qpid/sys/Thread.h @@ -25,8 +25,8 @@ #include <qpid/sys/Runnable.h> #ifdef USE_APR -# include <apr-1/apr_thread_proc.h> -# include <apr-1/apr_portable.h> +# include <apr_thread_proc.h> +# include <apr_portable.h> # include <qpid/apr/APRPool.h> # include <qpid/apr/APRBase.h> #else diff --git a/cpp/src/qpid/sys/Time.h b/cpp/src/qpid/sys/Time.h index 7fa2f2d8e7..a569c90780 100644 --- a/cpp/src/qpid/sys/Time.h +++ b/cpp/src/qpid/sys/Time.h @@ -25,7 +25,7 @@ #include <stdint.h> #ifdef USE_APR -# include <apr-1/apr_time.h> +# include <apr_time.h> #else # include <time.h> #endif diff --git a/cpp/src/qpid/sys/signal.h b/cpp/src/qpid/sys/signal.h index 6cae2b9e4a..b7cfc8a950 100644 --- a/cpp/src/qpid/sys/signal.h +++ b/cpp/src/qpid/sys/signal.h @@ -20,7 +20,7 @@ */ #ifdef USE_APR -# include <apr-1/apr_signal.h> +# include <apr_signal.h> #else # include <signal.h> #endif diff --git a/cpp/test/unit/qpid/posix/EpollEventChannelTest.cpp b/cpp/test/unit/qpid/posix/EpollEventChannelTest.cpp deleted file mode 100644 index 14a09937f0..0000000000 --- a/cpp/test/unit/qpid/posix/EpollEventChannelTest.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include <qpid/posix/EpollEventChannel.h> -#include <qpid_test_plugin.h> -#include <iostream> - -using namespace qpid::sys; - -class EpollEventChannelTest : public CppUnit::TestCase -{ - CPPUNIT_TEST_SUITE(EpollEventChannelTest); - CPPUNIT_TEST(testRead); - CPPUNIT_TEST_SUITE_END(); - - public: - - void testRead() - { - static const std::string msg("hello"); - static const ssize_t size = msg.size()+1; - - int p[2]; - CHECK0(pipe(p)); - - char readBuf[size]; - ReadEvent re(p[0], readBuf, size); - - CPPUNIT_ASSERT_EQUAL(size, write(p[1], msg.c_str(), size)); - CPPUNIT_ASSERT_EQUAL(size, read(p[0], readBuf, size)); - CPPUNIT_ASSERT_EQUAL(msg, std::string(readBuf)); - - EpollEventChannel ec; - ec.post(re); - - - ReadEvent* e = static_cast<ReadEvent*>(ec.getEvent()); - CPPUNIT_ASSERT_EQUAL(&re, e); - - CPPUNIT_ASSERT_EQUAL(msg, std::string(readBuf)) - - CPPUNIT_FAIL("Unfinished - not using ec"); - } - - void testPartialRead() - { - CPPUNIT_FAIL("Partial reads: shoul EQ collect full message?"); - } -}; - -// Make this test suite a plugin. -CPPUNIT_PLUGIN_IMPLEMENT(); -CPPUNIT_TEST_SUITE_REGISTRATION(EpollEventChannelTest); - |