diff options
| author | Stephen D. Huston <shuston@apache.org> | 2009-03-12 20:55:34 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2009-03-12 20:55:34 +0000 |
| commit | 0398410e8894287da530cfb63d6344817445bfc2 (patch) | |
| tree | e4d789cd965f25c8fb0a51e1cf71df0a5330e73b /cpp/src/qpid/sys | |
| parent | 47db7ebfc533d2dc8a3dfc3b9d1273730b8779e6 (diff) | |
| download | qpid-python-0398410e8894287da530cfb63d6344817445bfc2.tar.gz | |
Changes to build DLLs instead of static libs on Windows; primarily added decorators to exported names. Fixes QPID-1673
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@753014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
| -rw-r--r-- | cpp/src/qpid/sys/AggregateOutput.h | 15 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIO.h | 12 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/AsynchIOHandler.h | 27 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/DispatchHandle.h | 28 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Dispatcher.h | 7 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/IOHandle.h | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/PollableCondition.h | 13 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Poller.h | 28 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Runnable.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Shlib.h | 11 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Socket.h | 24 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/StrError.h | 3 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/SystemInfo.h | 15 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Thread.h | 13 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Time.h | 24 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/Timer.h | 28 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/alloca.h | 39 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/windows/uuid.h | 13 |
18 files changed, 181 insertions, 128 deletions
diff --git a/cpp/src/qpid/sys/AggregateOutput.h b/cpp/src/qpid/sys/AggregateOutput.h index 1cda4456b4..fcd0d4c2f7 100644 --- a/cpp/src/qpid/sys/AggregateOutput.h +++ b/cpp/src/qpid/sys/AggregateOutput.h @@ -24,6 +24,7 @@ #include "Mutex.h" #include "OutputControl.h" #include "OutputTask.h" +#include "qpid/CommonImportExport.h" #include <algorithm> #include <vector> @@ -42,15 +43,15 @@ namespace sys { public: AggregateOutput(OutputControl& c) : next(0), control(c) {}; //this may be called on any thread - void activateOutput(); - void giveReadCredit(int32_t); + QPID_COMMON_EXTERN void activateOutput(); + QPID_COMMON_EXTERN void giveReadCredit(int32_t); //all the following will be called on the same thread - bool doOutput(); - bool hasOutput(); - void addOutputTask(OutputTask* t); - void removeOutputTask(OutputTask* t); - void removeAll(); + QPID_COMMON_EXTERN bool doOutput(); + QPID_COMMON_EXTERN bool hasOutput(); + QPID_COMMON_EXTERN void addOutputTask(OutputTask* t); + QPID_COMMON_EXTERN void removeOutputTask(OutputTask* t); + QPID_COMMON_EXTERN void removeAll(); /** Apply f to each OutputTask* in the tasks list */ template <class F> void eachOutput(F f) { diff --git a/cpp/src/qpid/sys/AsynchIO.h b/cpp/src/qpid/sys/AsynchIO.h index ffd4436c2a..fb02183359 100644 --- a/cpp/src/qpid/sys/AsynchIO.h +++ b/cpp/src/qpid/sys/AsynchIO.h @@ -22,7 +22,7 @@ */ #include "qpid/sys/IntegerTypes.h" - +#include "qpid/CommonImportExport.h" #include <boost/function.hpp> #include <boost/shared_ptr.hpp> @@ -45,9 +45,9 @@ private: AsynchAcceptorPrivate* impl; public: - AsynchAcceptor(const Socket& s, Callback callback); - ~AsynchAcceptor(); - void start(boost::shared_ptr<Poller> poller); + QPID_COMMON_EXTERN AsynchAcceptor(const Socket& s, Callback callback); + QPID_COMMON_EXTERN ~AsynchAcceptor(); + QPID_COMMON_EXTERN void start(boost::shared_ptr<Poller> poller); }; /* @@ -65,7 +65,7 @@ public: // create a correctly typed object. The platform code also manages // deletes. To correctly manage heaps when needed, the allocate and // delete should both be done from the same class/library. - static AsynchConnector* create(const Socket& s, + QPID_COMMON_EXTERN static AsynchConnector* create(const Socket& s, boost::shared_ptr<Poller> poller, std::string hostname, uint16_t port, @@ -121,7 +121,7 @@ public: // create a correctly typed object. The platform code also manages // deletes. To correctly manage heaps when needed, the allocate and // delete should both be done from the same class/library. - static AsynchIO* create(const Socket& s, + QPID_COMMON_EXTERN static AsynchIO* create(const Socket& s, ReadCallback rCb, EofCallback eofCb, DisconnectCallback disCb, diff --git a/cpp/src/qpid/sys/AsynchIOHandler.h b/cpp/src/qpid/sys/AsynchIOHandler.h index fa020fbce4..9f1d043b62 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.h +++ b/cpp/src/qpid/sys/AsynchIOHandler.h @@ -25,6 +25,7 @@ #include "ConnectionCodec.h" #include "AtomicValue.h" #include "Mutex.h" +#include "qpid/CommonImportExport.h" namespace qpid { @@ -52,26 +53,26 @@ class AsynchIOHandler : public OutputControl { void write(const framing::ProtocolInitiation&); public: - AsynchIOHandler(std::string id, ConnectionCodec::Factory* f); - ~AsynchIOHandler(); - void init(AsynchIO* a, int numBuffs); + QPID_COMMON_EXTERN AsynchIOHandler(std::string id, ConnectionCodec::Factory* f); + QPID_COMMON_EXTERN ~AsynchIOHandler(); + QPID_COMMON_EXTERN void init(AsynchIO* a, int numBuffs); - void setClient() { isClient = true; } + QPID_COMMON_EXTERN void setClient() { isClient = true; } // Output side - void close(); - void activateOutput(); - void giveReadCredit(int32_t credit); + QPID_COMMON_EXTERN void close(); + QPID_COMMON_EXTERN void activateOutput(); + QPID_COMMON_EXTERN void giveReadCredit(int32_t credit); // Input side - bool readbuff(AsynchIO& aio, AsynchIOBufferBase* buff); - void eof(AsynchIO& aio); - void disconnect(AsynchIO& aio); + QPID_COMMON_EXTERN bool readbuff(AsynchIO& aio, AsynchIOBufferBase* buff); + QPID_COMMON_EXTERN void eof(AsynchIO& aio); + QPID_COMMON_EXTERN void disconnect(AsynchIO& aio); // Notifications - void nobuffs(AsynchIO& aio); - void idle(AsynchIO& aio); - void closedSocket(AsynchIO& aio, const Socket& s); + QPID_COMMON_EXTERN void nobuffs(AsynchIO& aio); + QPID_COMMON_EXTERN void idle(AsynchIO& aio); + QPID_COMMON_EXTERN void closedSocket(AsynchIO& aio, const Socket& s); }; }} // namespace qpid::sys diff --git a/cpp/src/qpid/sys/DispatchHandle.h b/cpp/src/qpid/sys/DispatchHandle.h index fb114ce5be..bc9f98775e 100644 --- a/cpp/src/qpid/sys/DispatchHandle.h +++ b/cpp/src/qpid/sys/DispatchHandle.h @@ -24,7 +24,7 @@ #include "Poller.h" #include "Mutex.h" - +#include "qpid/CommonImportExport.h" #include <boost/function.hpp> #include <queue> @@ -83,7 +83,7 @@ public: *@param wCb Callback called when the handle is writable. *@param dCb Callback called when the handle is disconnected. */ - DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb) : + QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb) : PollerHandle(h), readableCallback(rCb), writableCallback(wCb), @@ -91,42 +91,42 @@ public: state(IDLE) {} - ~DispatchHandle(); + QPID_COMMON_EXTERN ~DispatchHandle(); /** Add this DispatchHandle to the poller to be watched. */ - void startWatch(Poller::shared_ptr poller); + QPID_COMMON_EXTERN void startWatch(Poller::shared_ptr poller); /** Resume watching for all non-0 callbacks. */ - void rewatch(); + QPID_COMMON_EXTERN void rewatch(); /** Resume watching for read only. */ - void rewatchRead(); + QPID_COMMON_EXTERN void rewatchRead(); /** Resume watching for write only. */ - void rewatchWrite(); + QPID_COMMON_EXTERN void rewatchWrite(); /** Stop watching temporarily. The DispatchHandle remains associated with the poller and can be re-activated using rewatch. */ - void unwatch(); + QPID_COMMON_EXTERN void unwatch(); /** Stop watching for read */ - void unwatchRead(); + QPID_COMMON_EXTERN void unwatchRead(); /** Stop watching for write */ - void unwatchWrite(); + QPID_COMMON_EXTERN void unwatchWrite(); /** Stop watching permanently. Disassociates from the poller. */ - void stopWatch(); + QPID_COMMON_EXTERN void stopWatch(); /** Interrupt watching this handle and make a serialised callback that respects the * same exclusivity guarantees as the other callbacks */ - void call(Callback iCb); + QPID_COMMON_EXTERN void call(Callback iCb); protected: /** Override to get extra processing done when the DispatchHandle is deleted. */ - void doDelete(); + QPID_COMMON_EXTERN void doDelete(); private: - void processEvent(Poller::EventType dir); + QPID_COMMON_EXTERN void processEvent(Poller::EventType dir); }; class DispatchHandleRef { diff --git a/cpp/src/qpid/sys/Dispatcher.h b/cpp/src/qpid/sys/Dispatcher.h index f7c9e8d731..2f3ed10901 100644 --- a/cpp/src/qpid/sys/Dispatcher.h +++ b/cpp/src/qpid/sys/Dispatcher.h @@ -24,6 +24,7 @@ #include "Poller.h" #include "Runnable.h" +#include "qpid/CommonImportExport.h" namespace qpid { namespace sys { @@ -32,10 +33,10 @@ class Dispatcher : public Runnable { const Poller::shared_ptr poller; public: - Dispatcher(Poller::shared_ptr poller); - ~Dispatcher(); + QPID_COMMON_EXTERN Dispatcher(Poller::shared_ptr poller); + QPID_COMMON_EXTERN ~Dispatcher(); - void run(); + QPID_COMMON_EXTERN void run(); }; }} diff --git a/cpp/src/qpid/sys/IOHandle.h b/cpp/src/qpid/sys/IOHandle.h index 0bf2abbafa..656e5e1efd 100644 --- a/cpp/src/qpid/sys/IOHandle.h +++ b/cpp/src/qpid/sys/IOHandle.h @@ -22,6 +22,8 @@ * */ +#include "qpid/CommonImportExport.h" + namespace qpid { namespace sys { @@ -50,8 +52,8 @@ class IOHandle { protected: IOHandlePrivate* const impl; - IOHandle(IOHandlePrivate*); - virtual ~IOHandle(); + IOHandle(IOHandlePrivate*); + QPID_COMMON_EXTERN virtual ~IOHandle(); }; }} diff --git a/cpp/src/qpid/sys/PollableCondition.h b/cpp/src/qpid/sys/PollableCondition.h index 49e84e6cb0..f49fb22cb4 100644 --- a/cpp/src/qpid/sys/PollableCondition.h +++ b/cpp/src/qpid/sys/PollableCondition.h @@ -23,6 +23,7 @@ */ #include "qpid/sys/Poller.h" +#include "qpid/CommonImportExport.h" #include <boost/function.hpp> #include <boost/shared_ptr.hpp> @@ -36,35 +37,35 @@ class PollableCondition { public: typedef boost::function1<void, PollableCondition&> Callback; - PollableCondition(const Callback& cb, + QPID_COMMON_EXTERN PollableCondition(const Callback& cb, const boost::shared_ptr<sys::Poller>& poller); - ~PollableCondition(); + QPID_COMMON_EXTERN ~PollableCondition(); /** * Set the condition. Triggers callback to Callback from Poller. * When callback is made, condition is suspended. Call rearm() to * resume reacting to the condition. */ - void set(); + QPID_COMMON_EXTERN void set(); /** * Get the current state of the condition, then clear it. * * @return The state of the condition before it was cleared. */ - bool clear(); + QPID_COMMON_EXTERN bool clear(); /** * Temporarily suspend the ability for the poller to react to the * condition. It can be rearm()ed later. */ - void disarm(); + QPID_COMMON_EXTERN void disarm(); /** * Reset the ability for the poller to react to the condition. */ - void rearm(); + QPID_COMMON_EXTERN void rearm(); private: PollableConditionPrivate *impl; diff --git a/cpp/src/qpid/sys/Poller.h b/cpp/src/qpid/sys/Poller.h index 96b4b9c361..825ad8bfed 100644 --- a/cpp/src/qpid/sys/Poller.h +++ b/cpp/src/qpid/sys/Poller.h @@ -24,7 +24,7 @@ #include "Time.h" #include "Runnable.h" - +#include "qpid/CommonImportExport.h" #include <boost/shared_ptr.hpp> namespace qpid { @@ -74,10 +74,10 @@ public: void process(); }; - Poller(); - ~Poller(); + QPID_COMMON_EXTERN Poller(); + QPID_COMMON_EXTERN ~Poller(); /** Note: this function is async-signal safe */ - void shutdown(); + QPID_COMMON_EXTERN void shutdown(); // Interrupt waiting for a specific poller handle // returns true if we could interrupt the handle @@ -89,16 +89,16 @@ public: // reported and has not been reenabled since. // - Because it was removed from the monitoring set // - Or because it is already being interrupted - bool interrupt(PollerHandle& handle); + QPID_COMMON_EXTERN bool interrupt(PollerHandle& handle); // Poller run loop - void run(); + QPID_COMMON_EXTERN void run(); - void addFd(PollerHandle& handle, Direction dir); - void delFd(PollerHandle& handle); - void modFd(PollerHandle& handle, Direction dir); - void rearmFd(PollerHandle& handle); - Event wait(Duration timeout = TIME_INFINITE); + QPID_COMMON_EXTERN void addFd(PollerHandle& handle, Direction dir); + QPID_COMMON_EXTERN void delFd(PollerHandle& handle); + QPID_COMMON_EXTERN void modFd(PollerHandle& handle, Direction dir); + QPID_COMMON_EXTERN void rearmFd(PollerHandle& handle); + QPID_COMMON_EXTERN Event wait(Duration timeout = TIME_INFINITE); }; /** @@ -111,11 +111,11 @@ class PollerHandle { friend struct Poller::Event; PollerHandlePrivate* const impl; - virtual void processEvent(Poller::EventType) {}; + QPID_COMMON_EXTERN virtual void processEvent(Poller::EventType) {}; public: - PollerHandle(const IOHandle& h); - virtual ~PollerHandle(); + QPID_COMMON_EXTERN PollerHandle(const IOHandle& h); + QPID_COMMON_EXTERN virtual ~PollerHandle(); }; inline void Poller::Event::process() { diff --git a/cpp/src/qpid/sys/Runnable.h b/cpp/src/qpid/sys/Runnable.h index fb3927c612..4bf43c93d1 100644 --- a/cpp/src/qpid/sys/Runnable.h +++ b/cpp/src/qpid/sys/Runnable.h @@ -22,6 +22,7 @@ */ #include <boost/function.hpp> +#include "qpid/CommonImportExport.h" namespace qpid { namespace sys { @@ -35,7 +36,7 @@ class Runnable /** Type to represent a runnable as a Functor */ typedef boost::function0<void> Functor; - virtual ~Runnable(); + QPID_COMMON_EXTERN virtual ~Runnable(); /** Derived classes override run(). */ virtual void run() = 0; diff --git a/cpp/src/qpid/sys/Shlib.h b/cpp/src/qpid/sys/Shlib.h index a6d94b42d4..7f66cfec14 100644 --- a/cpp/src/qpid/sys/Shlib.h +++ b/cpp/src/qpid/sys/Shlib.h @@ -21,7 +21,8 @@ * under the License. * */ - + +#include "qpid/CommonImportExport.h" #include <boost/noncopyable.hpp> #include <iostream> @@ -40,10 +41,10 @@ class Shlib { Shlib(const std::string& libname) { load(libname.c_str()); } /** Unload shared library. */ - void unload(); + QPID_COMMON_EXTERN void unload(); /** Look up symbol. */ - void* getSymbol(const char* symbol); + QPID_COMMON_EXTERN void* getSymbol(const char* symbol); /** Look up symbol in shared library, cast it to the desired * pointer type, void* by default. @@ -57,7 +58,7 @@ class Shlib { private: void* handle; - void load(const char* libname); + QPID_COMMON_EXTERN void load(const char* libname); }; /** A shared library handle that unloads the shlib in it's dtor */ @@ -66,7 +67,7 @@ class AutoShlib : public Shlib { /** Load shared library */ AutoShlib(const std::string& libname) : Shlib(libname) {} /** Calls unload() */ - ~AutoShlib() throw(); + QPID_COMMON_EXTERN ~AutoShlib() throw(); }; diff --git a/cpp/src/qpid/sys/Socket.h b/cpp/src/qpid/sys/Socket.h index 9b749bdf5e..e6555f5774 100644 --- a/cpp/src/qpid/sys/Socket.h +++ b/cpp/src/qpid/sys/Socket.h @@ -24,7 +24,7 @@ #include "IOHandle.h" #include "qpid/sys/IntegerTypes.h" - +#include "qpid/CommonImportExport.h" #include <string> namespace qpid { @@ -36,7 +36,7 @@ class Socket : public IOHandle { public: /** Create a socket wrapper for descriptor. */ - Socket(); + QPID_COMMON_EXTERN Socket(); /** Create an initialized TCP socket */ void createTcp() const; @@ -47,21 +47,21 @@ public: /** Set socket non blocking */ void setNonblocking() const; - void connect(const std::string& host, uint16_t port) const; + QPID_COMMON_EXTERN void connect(const std::string& host, uint16_t port) const; - void close() const; + QPID_COMMON_EXTERN void close() const; /** Bind to a port and start listening. *@param port 0 means choose an available port. *@param backlog maximum number of pending connections. *@return The bound port. */ - int listen(uint16_t port = 0, int backlog = 10) const; + QPID_COMMON_EXTERN int listen(uint16_t port = 0, int backlog = 10) const; /** Returns the "socket name" ie the address bound to * the near end of the socket */ - std::string getSockname() const; + QPID_COMMON_EXTERN std::string getSockname() const; /** Returns the "peer name" ie the address bound to * the remote end of the socket @@ -72,14 +72,14 @@ public: * Returns an address (host and port) for the remote end of the * socket */ - std::string getPeerAddress() const; + QPID_COMMON_EXTERN std::string getPeerAddress() const; /** * Returns an address (host and port) for the local end of the * socket */ std::string getLocalAddress() const; - uint16_t getLocalPort() const; + QPID_COMMON_EXTERN uint16_t getLocalPort() const; uint16_t getRemotePort() const; /** @@ -91,13 +91,13 @@ public: /** Accept a connection from a socket that is already listening * and has an incoming connection */ - Socket* accept() const; + QPID_COMMON_EXTERN Socket* accept() const; // TODO The following are raw operations, maybe they need better wrapping? - int read(void *buf, size_t count) const; - int write(const void *buf, size_t count) const; + QPID_COMMON_EXTERN int read(void *buf, size_t count) const; + QPID_COMMON_EXTERN int write(const void *buf, size_t count) const; - void setTcpNoDelay(bool nodelay) const; + QPID_COMMON_EXTERN void setTcpNoDelay(bool nodelay) const; private: Socket(IOHandlePrivate*); diff --git a/cpp/src/qpid/sys/StrError.h b/cpp/src/qpid/sys/StrError.h index 3843f2abe1..69cc7e714c 100644 --- a/cpp/src/qpid/sys/StrError.h +++ b/cpp/src/qpid/sys/StrError.h @@ -23,12 +23,13 @@ */ #include <string> +#include "qpid/CommonImportExport.h" namespace qpid { namespace sys { /** Get the error message for a system number err, e.g. errno. */ -std::string strError(int err); +QPID_COMMON_EXTERN std::string strError(int err); }} // namespace qpid diff --git a/cpp/src/qpid/sys/SystemInfo.h b/cpp/src/qpid/sys/SystemInfo.h index 017a05e2c5..6e97022b36 100644 --- a/cpp/src/qpid/sys/SystemInfo.h +++ b/cpp/src/qpid/sys/SystemInfo.h @@ -23,6 +23,7 @@ #include "qpid/sys/IntegerTypes.h" #include "qpid/Address.h" +#include "qpid/CommonImportExport.h" namespace qpid { namespace sys { @@ -36,15 +37,15 @@ namespace SystemInfo { * Estimate available concurrency, e.g. number of CPU cores. * -1 means estimate not available on this platform. */ - long concurrency(); + QPID_COMMON_EXTERN long concurrency(); /** * Get the local host name and set it in the specified TcpAddress. * Returns false if it can't be obtained and sets errno to any error value. */ - bool getLocalHostname (TcpAddress &address); + QPID_COMMON_EXTERN bool getLocalHostname (TcpAddress &address); - void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList); + QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList); /** * Retrieve system identifiers and versions. This is information that can @@ -57,7 +58,7 @@ namespace SystemInfo { * @param version Receives the OS release version (kernel, build, sp, etc.) * @param machine Receives the hardware type. */ - void getSystemId (std::string &osName, + QPID_COMMON_EXTERN void getSystemId (std::string &osName, std::string &nodeName, std::string &release, std::string &version, @@ -66,17 +67,17 @@ namespace SystemInfo { /** * Get the process ID of the current process. */ - uint32_t getProcessId(); + QPID_COMMON_EXTERN uint32_t getProcessId(); /** * Get the process ID of the parent of the current process. */ - uint32_t getParentProcessId(); + QPID_COMMON_EXTERN uint32_t getParentProcessId(); /** * Get the name of the current process (i.e. the name of the executable) */ - std::string getProcessName(); + QPID_COMMON_EXTERN std::string getProcessName(); }}} // namespace qpid::sys::SystemInfo diff --git a/cpp/src/qpid/sys/Thread.h b/cpp/src/qpid/sys/Thread.h index 1531f9619c..b532d4d80a 100644 --- a/cpp/src/qpid/sys/Thread.h +++ b/cpp/src/qpid/sys/Thread.h @@ -22,6 +22,7 @@ * */ #include <boost/shared_ptr.hpp> +#include "qpid/CommonImportExport.h" #ifdef _WIN32 # define QPID_TSS __declspec(thread) @@ -44,15 +45,15 @@ class Thread boost::shared_ptr<ThreadPrivate> impl; public: - Thread(); - explicit Thread(qpid::sys::Runnable*); - explicit Thread(qpid::sys::Runnable&); + QPID_COMMON_EXTERN Thread(); + QPID_COMMON_EXTERN explicit Thread(qpid::sys::Runnable*); + QPID_COMMON_EXTERN explicit Thread(qpid::sys::Runnable&); - void join(); + QPID_COMMON_EXTERN void join(); - unsigned long id(); + QPID_COMMON_EXTERN unsigned long id(); - static Thread current(); + QPID_COMMON_EXTERN static Thread current(); /** ID of current thread for logging. * Workaround for broken Thread::current() in APR diff --git a/cpp/src/qpid/sys/Time.h b/cpp/src/qpid/sys/Time.h index d39be95434..b7173406ca 100644 --- a/cpp/src/qpid/sys/Time.h +++ b/cpp/src/qpid/sys/Time.h @@ -33,6 +33,8 @@ # include "posix/Time.h" #endif +#include "qpid/CommonImportExport.h" + #include <limits> #include <iosfwd> @@ -86,23 +88,23 @@ class AbsTime { TimePrivate timepoint; public: - inline AbsTime() {} - AbsTime(const AbsTime& time0, const Duration& duration); + QPID_COMMON_EXTERN inline AbsTime() {} + QPID_COMMON_EXTERN AbsTime(const AbsTime& time0, const Duration& duration); // Default assignment operation fine // Default copy constructor fine - static AbsTime now(); - static AbsTime FarFuture(); + QPID_COMMON_EXTERN static AbsTime now(); + QPID_COMMON_EXTERN static AbsTime FarFuture(); const TimePrivate& getPrivate(void) const { return timepoint; } bool operator==(const AbsTime& t) const { return t.timepoint == timepoint; } template <class S> void serialize(S& s) { s(timepoint); } friend bool operator<(const AbsTime& a, const AbsTime& b); friend bool operator>(const AbsTime& a, const AbsTime& b); - friend std::ostream& operator << (std::ostream&, const AbsTime&); + QPID_COMMON_EXTERN friend std::ostream& operator << (std::ostream&, const AbsTime&); }; -std::ostream& operator << (std::ostream&, const AbsTime&); +QPID_COMMON_EXTERN std::ostream& operator << (std::ostream&, const AbsTime&); /** * @class Duration @@ -120,9 +122,9 @@ class Duration { friend class AbsTime; public: - inline Duration(int64_t time0); - explicit Duration(const AbsTime& time0); - explicit Duration(const AbsTime& start, const AbsTime& finish); + QPID_COMMON_EXTERN inline Duration(int64_t time0); + QPID_COMMON_EXTERN explicit Duration(const AbsTime& time0); + QPID_COMMON_EXTERN explicit Duration(const AbsTime& start, const AbsTime& finish); inline operator int64_t() const; }; @@ -158,10 +160,10 @@ const Duration TIME_INFINITE = std::numeric_limits<int64_t>::max(); const AbsTime FAR_FUTURE = AbsTime::FarFuture(); /** Portable sleep for a number of seconds */ -void sleep(int secs); +QPID_COMMON_EXTERN void sleep(int secs); /** Portable sleep for a number of microseconds */ -void usleep(uint64_t usecs); +QPID_COMMON_EXTERN void usleep(uint64_t usecs); }} diff --git a/cpp/src/qpid/sys/Timer.h b/cpp/src/qpid/sys/Timer.h index 2561e41034..dab2f55edb 100644 --- a/cpp/src/qpid/sys/Timer.h +++ b/cpp/src/qpid/sys/Timer.h @@ -25,7 +25,7 @@ #include "qpid/sys/Thread.h" #include "qpid/sys/Runnable.h" #include "qpid/RefCounted.h" - +#include "qpid/CommonImportExport.h" #include <memory> #include <queue> @@ -49,15 +49,15 @@ class TimerTask : public RefCounted { void fireTask(); public: - TimerTask(Duration period); - TimerTask(AbsTime fireTime); - virtual ~TimerTask(); + QPID_COMMON_EXTERN TimerTask(Duration period); + QPID_COMMON_EXTERN TimerTask(AbsTime fireTime); + QPID_COMMON_EXTERN virtual ~TimerTask(); - void setupNextFire(); - void restart(); - void delayTill(AbsTime fireTime); - void cancel(); - bool isCancelled() const; + QPID_COMMON_EXTERN void setupNextFire(); + QPID_COMMON_EXTERN void restart(); + QPID_COMMON_EXTERN void delayTill(AbsTime fireTime); + QPID_COMMON_EXTERN void cancel(); + QPID_COMMON_EXTERN bool isCancelled() const; protected: // Must be overridden with callback @@ -78,12 +78,12 @@ class Timer : private Runnable { void run(); public: - Timer(); - ~Timer(); + QPID_COMMON_EXTERN Timer(); + QPID_COMMON_EXTERN ~Timer(); - void add(boost::intrusive_ptr<TimerTask> task); - void start(); - void stop(); + QPID_COMMON_EXTERN void add(boost::intrusive_ptr<TimerTask> task); + QPID_COMMON_EXTERN void start(); + QPID_COMMON_EXTERN void stop(); }; diff --git a/cpp/src/qpid/sys/alloca.h b/cpp/src/qpid/sys/alloca.h new file mode 100644 index 0000000000..e989670e4f --- /dev/null +++ b/cpp/src/qpid/sys/alloca.h @@ -0,0 +1,39 @@ +#ifndef QPID_SYS_ALLOCA_H +#define QPID_SYS_ALLOCA_H + +/* + * 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. + * + */ + +#if (defined(_WINDOWS) || defined (WIN32)) && defined(_MSC_VER) +#include <malloc.h> +#ifdef alloc +# undef alloc +#endif +#define alloc _alloc +#ifdef alloca +# undef alloca +#endif +#define alloca _alloca +#endif +#if !defined _WINDOWS && !defined WIN32 +#include <alloca.h> +#endif + +#endif /*!QPID_SYS_ALLOCA_H*/ diff --git a/cpp/src/qpid/sys/windows/uuid.h b/cpp/src/qpid/sys/windows/uuid.h index a44ef2e9a3..7d003c3739 100644 --- a/cpp/src/qpid/sys/windows/uuid.h +++ b/cpp/src/qpid/sys/windows/uuid.h @@ -23,6 +23,7 @@ */ #include <Rpc.h> +#include "qpid/CommonImportExport.h" #ifdef uuid_t /* Done in rpcdce.h */ # undef uuid_t @@ -31,11 +32,11 @@ namespace qpid { namespace sys { const size_t UuidSize = 16; }} typedef uint8_t uuid_t[qpid::sys::UuidSize]; -void uuid_clear (uuid_t uu); -void uuid_copy (uuid_t dst, const uuid_t src); -void uuid_generate (uuid_t out); -int uuid_is_null (const uuid_t uu); // Returns 1 if null, else 0 -int uuid_parse (const char *in, uuid_t uu); // Returns 0 on success, else -1 -void uuid_unparse (const uuid_t uu, char *out); +QPID_COMMON_EXTERN void uuid_clear (uuid_t uu); +QPID_COMMON_EXTERN void uuid_copy (uuid_t dst, const uuid_t src); +QPID_COMMON_EXTERN void uuid_generate (uuid_t out); +QPID_COMMON_EXTERN int uuid_is_null (const uuid_t uu); // Returns 1 if null, else 0 +QPID_COMMON_EXTERN int uuid_parse (const char *in, uuid_t uu); // Returns 0 on success, else -1 +QPID_COMMON_EXTERN void uuid_unparse (const uuid_t uu, char *out); #endif /*!_sys_windows_uuid_h*/ |
