Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
check.h
Go to the documentation of this file.
1 #ifndef _windows_check_h
2 #define _windows_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 #include "qpid/sys/StrError.h"
28 
29 #define QPID_WINDOWS_ERROR(ERRVAL) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRVAL)))
30 #define QPID_WINDOWS_CRT_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO)))
31 
33 #define QPID_WINDOWS_CHECK_NULL(RESULT) \
34  if ((RESULT) == NULL) throw QPID_WINDOWS_ERROR((::GetLastError()))
35 
36 #define QPID_WINDOWS_CHECK_NOT(RESULT,VAL) \
37  if ((RESULT) == (VAL)) throw QPID_WINDOWS_ERROR((::GetLastError()))
38 
39 #define QPID_WINDOWS_CHECK_ASYNC_START(STATUS) \
40  if (!(STATUS) && ::WSAGetLastError() != ERROR_IO_PENDING) \
41  throw QPID_WINDOWS_ERROR((::WSAGetLastError()))
42 
43 #define QPID_WINDOWS_CHECK_CRT_NZ(VAL) \
44  if ((VAL) == 0) throw QPID_WINDOWS_CRT_ERROR(errno)
45 
46 #define QPID_WINSOCK_CHECK(OP) \
47  if ((OP) == SOCKET_ERROR) throw QPID_WINDOWS_ERROR((::WSAGetLastError()))
48 
49 #endif

Qpid C++ API Reference
Generated on Mon Sep 22 2014 for Qpid C++ Client API by doxygen 1.8.7