Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET
Apache Qpid Documentation
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
qpid
sys
posix
check.h
Go to the documentation of this file.
1
#ifndef _posix_check_h
2
#define _posix_check_h
3
4
/*
5
*
6
* Licensed to the Apache Software Foundation (ASF) under one
7
* or more contributor license agreements. See the NOTICE file
8
* distributed with this work for additional information
9
* regarding copyright ownership. The ASF licenses this file
10
* to you under the Apache License, Version 2.0 (the
11
* "License"); you may not use this file except in compliance
12
* with the License. You may obtain a copy of the License at
13
*
14
* http://www.apache.org/licenses/LICENSE-2.0
15
*
16
* Unless required by applicable law or agreed to in writing,
17
* software distributed under the License is distributed on an
18
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
* KIND, either express or implied. See the License for the
20
* specific language governing permissions and limitations
21
* under the License.
22
*
23
*/
24
25
#include "
qpid/Exception.h
"
26
#include "
qpid/Msg.h
"
27
28
#include <cerrno>
29
#include <assert.h>
30
#include <stdio.h>
31
#include <stdlib.h>
32
33
#define QPID_POSIX_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO)))
34
36
#define QPID_POSIX_CHECK(RESULT) \
37
if ((RESULT) < 0) throw QPID_POSIX_ERROR((errno))
38
40
#define QPID_POSIX_THROW_IF(ERRNO) \
41
do { int e=(ERRNO); if (e) throw QPID_POSIX_ERROR(e); } while(0)
42
44
#ifdef NDEBUG
45
#define QPID_POSIX_ASSERT_THROW_IF(ERRNO) QPID_POSIX_THROW_IF(ERRNO)
46
#else
47
#define QPID_POSIX_ASSERT_THROW_IF(ERRNO) \
48
do { int e=(ERRNO); if (e) { errno=e; ::perror(0); assert(0); } } while(0)
49
#endif
50
51
#define QPID_POSIX_ABORT_IF(ERRNO) if ((int) ERRNO) { errno=ERRNO; ::perror(0); abort(); }
52
53
#endif
Qpid C++ API Reference
Generated on Mon Jul 15 2013 for Qpid C++ Client API by
1.8.3.1