libzmq master
The Intelligent Transport Layer

zmq_utils.h

Go to the documentation of this file.
00001 /*
00002     Copyright (c) 2009-2011 250bpm s.r.o.
00003     Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
00004 
00005     This file is part of 0MQ.
00006 
00007     0MQ is free software; you can redistribute it and/or modify it under
00008     the terms of the GNU Lesser General Public License as published by
00009     the Free Software Foundation; either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     0MQ is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef __ZMQ_UTILS_H_INCLUDED__
00022 #define __ZMQ_UTILS_H_INCLUDED__
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 /*  Handle DSO symbol visibility                                             */
00029 #if defined _WIN32
00030 #   if defined DLL_EXPORT
00031 #       define ZMQ_EXPORT __declspec(dllexport)
00032 #   else
00033 #       define ZMQ_EXPORT __declspec(dllimport)
00034 #   endif
00035 #else
00036 #   if defined __SUNPRO_C  || defined __SUNPRO_CC
00037 #       define ZMQ_EXPORT __global
00038 #   elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
00039 #       define ZMQ_EXPORT __attribute__ ((visibility("default")))
00040 #   else
00041 #       define ZMQ_EXPORT
00042 #   endif
00043 #endif
00044 
00045 /*  Helper functions are used by perf tests so that they don't have to care   */
00046 /*  about minutiae of time-related functions on different OS platforms.       */
00047 
00048 /*  Starts the stopwatch. Returns the handle to the watch.                    */
00049 ZMQ_EXPORT void *zmq_stopwatch_start (void);
00050 
00051 /*  Stops the stopwatch. Returns the number of microseconds elapsed since     */
00052 /*  the stopwatch was started.                                                */
00053 ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_);
00054 
00055 /*  Sleeps for specified number of seconds.                                   */
00056 ZMQ_EXPORT void zmq_sleep (int seconds_);
00057 
00058 #undef ZMQ_EXPORT
00059 
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 
00064 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines