From f8270eed56acb48d362ec0d3bab1fb89d1c568c9 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 17 Jul 2009 19:30:55 +0000 Subject: Move remaining needed Windows files from src/qpid/sys/windows to include/qpid/sys/windows git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@795202 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/include/qpid/sys/windows/IntegerTypes.h | 38 +++++++++++++++++++++++ cpp/include/qpid/sys/windows/check.h | 48 +++++++++++++++++++++++++++++ cpp/include/qpid/sys/windows/uuid.h | 38 +++++++++++++++++++++++ cpp/src/qpid/sys/windows/IntegerTypes.h | 38 ----------------------- cpp/src/qpid/sys/windows/check.h | 48 ----------------------------- cpp/src/qpid/sys/windows/uuid.h | 38 ----------------------- 6 files changed, 124 insertions(+), 124 deletions(-) create mode 100755 cpp/include/qpid/sys/windows/IntegerTypes.h create mode 100755 cpp/include/qpid/sys/windows/check.h create mode 100644 cpp/include/qpid/sys/windows/uuid.h delete mode 100755 cpp/src/qpid/sys/windows/IntegerTypes.h delete mode 100755 cpp/src/qpid/sys/windows/check.h delete mode 100644 cpp/src/qpid/sys/windows/uuid.h (limited to 'cpp') diff --git a/cpp/include/qpid/sys/windows/IntegerTypes.h b/cpp/include/qpid/sys/windows/IntegerTypes.h new file mode 100755 index 0000000000..47b1d16a76 --- /dev/null +++ b/cpp/include/qpid/sys/windows/IntegerTypes.h @@ -0,0 +1,38 @@ +#ifndef QPID_SYS_WINDOWS_INTEGERTYPES_H +#define QPID_SYS_WINDOWS_INTEGERTYPES_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. + * + */ + +typedef unsigned char uint8_t; +typedef char int8_t; +typedef unsigned short uint16_t; +typedef short int16_t; +typedef unsigned int uint32_t; +typedef int int32_t; +typedef unsigned __int64 uint64_t; +typedef __int64 int64_t; + +// Visual Studio doesn't define other common types, so set them up here too. +typedef int pid_t; +typedef int ssize_t; +typedef unsigned int uint; + +#endif /*!QPID_SYS_WINDOWS_INTEGERTYPES_H*/ diff --git a/cpp/include/qpid/sys/windows/check.h b/cpp/include/qpid/sys/windows/check.h new file mode 100755 index 0000000000..aba38814b2 --- /dev/null +++ b/cpp/include/qpid/sys/windows/check.h @@ -0,0 +1,48 @@ +#ifndef _windows_check_h +#define _windows_check_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. + * + */ + +#include "qpid/Exception.h" +#include "qpid/sys/StrError.h" + +#define QPID_WINDOWS_ERROR(ERRVAL) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRVAL))) +#define QPID_WINDOWS_CRT_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO))) + +/** THROW QPID_WINDOWS_ERROR(::GetLastError()) if RESULT is NULL */ +#define QPID_WINDOWS_CHECK_NULL(RESULT) \ + if ((RESULT) == NULL) throw QPID_WINDOWS_ERROR((::GetLastError())) + +#define QPID_WINDOWS_CHECK_NOT(RESULT,VAL) \ + if ((RESULT) == (VAL)) throw QPID_WINDOWS_ERROR((::GetLastError())) + +#define QPID_WINDOWS_CHECK_ASYNC_START(STATUS) \ + if (!(STATUS) && ::WSAGetLastError() != ERROR_IO_PENDING) \ + throw QPID_WINDOWS_ERROR((::WSAGetLastError())) + +#define QPID_WINDOWS_CHECK_CRT_NZ(VAL) \ + if ((VAL) == 0) throw QPID_WINDOWS_CRT_ERROR(errno) + +#define QPID_WINSOCK_CHECK(OP) \ + if ((OP) == SOCKET_ERROR) throw QPID_WINDOWS_ERROR((::WSAGetLastError())) + +#endif /*!_windows_check_h*/ diff --git a/cpp/include/qpid/sys/windows/uuid.h b/cpp/include/qpid/sys/windows/uuid.h new file mode 100644 index 0000000000..c79abe95c6 --- /dev/null +++ b/cpp/include/qpid/sys/windows/uuid.h @@ -0,0 +1,38 @@ +#ifndef _sys_windows_uuid_h +#define _sys_windows_uuid_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. + * + */ + +#include "qpid/CommonImportExport.h" +#include + +namespace qpid { namespace sys { const size_t UuidSize = 16; }} +typedef uint8_t uuid_t[qpid::sys::UuidSize]; + +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*/ diff --git a/cpp/src/qpid/sys/windows/IntegerTypes.h b/cpp/src/qpid/sys/windows/IntegerTypes.h deleted file mode 100755 index 47b1d16a76..0000000000 --- a/cpp/src/qpid/sys/windows/IntegerTypes.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef QPID_SYS_WINDOWS_INTEGERTYPES_H -#define QPID_SYS_WINDOWS_INTEGERTYPES_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. - * - */ - -typedef unsigned char uint8_t; -typedef char int8_t; -typedef unsigned short uint16_t; -typedef short int16_t; -typedef unsigned int uint32_t; -typedef int int32_t; -typedef unsigned __int64 uint64_t; -typedef __int64 int64_t; - -// Visual Studio doesn't define other common types, so set them up here too. -typedef int pid_t; -typedef int ssize_t; -typedef unsigned int uint; - -#endif /*!QPID_SYS_WINDOWS_INTEGERTYPES_H*/ diff --git a/cpp/src/qpid/sys/windows/check.h b/cpp/src/qpid/sys/windows/check.h deleted file mode 100755 index aba38814b2..0000000000 --- a/cpp/src/qpid/sys/windows/check.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _windows_check_h -#define _windows_check_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. - * - */ - -#include "qpid/Exception.h" -#include "qpid/sys/StrError.h" - -#define QPID_WINDOWS_ERROR(ERRVAL) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRVAL))) -#define QPID_WINDOWS_CRT_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO))) - -/** THROW QPID_WINDOWS_ERROR(::GetLastError()) if RESULT is NULL */ -#define QPID_WINDOWS_CHECK_NULL(RESULT) \ - if ((RESULT) == NULL) throw QPID_WINDOWS_ERROR((::GetLastError())) - -#define QPID_WINDOWS_CHECK_NOT(RESULT,VAL) \ - if ((RESULT) == (VAL)) throw QPID_WINDOWS_ERROR((::GetLastError())) - -#define QPID_WINDOWS_CHECK_ASYNC_START(STATUS) \ - if (!(STATUS) && ::WSAGetLastError() != ERROR_IO_PENDING) \ - throw QPID_WINDOWS_ERROR((::WSAGetLastError())) - -#define QPID_WINDOWS_CHECK_CRT_NZ(VAL) \ - if ((VAL) == 0) throw QPID_WINDOWS_CRT_ERROR(errno) - -#define QPID_WINSOCK_CHECK(OP) \ - if ((OP) == SOCKET_ERROR) throw QPID_WINDOWS_ERROR((::WSAGetLastError())) - -#endif /*!_windows_check_h*/ diff --git a/cpp/src/qpid/sys/windows/uuid.h b/cpp/src/qpid/sys/windows/uuid.h deleted file mode 100644 index c79abe95c6..0000000000 --- a/cpp/src/qpid/sys/windows/uuid.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _sys_windows_uuid_h -#define _sys_windows_uuid_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. - * - */ - -#include "qpid/CommonImportExport.h" -#include - -namespace qpid { namespace sys { const size_t UuidSize = 16; }} -typedef uint8_t uuid_t[qpid::sys::UuidSize]; - -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*/ -- cgit v1.2.1