summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2008-10-02 20:12:38 +0000
committerStephen D. Huston <shuston@apache.org>2008-10-02 20:12:38 +0000
commitc88162272d7802103fa4bb8852a32b43673d8955 (patch)
tree4ef0ce4dbfc2b0e1cc22dd2f93599d3f53180e85
parent32716cfa7eb0edce0c7e7e4828f7122b369ebf4c (diff)
downloadqpid-python-c88162272d7802103fa4bb8852a32b43673d8955.tar.gz
Resolve QPID-1311
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@701231 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/Makefile.am4
-rw-r--r--cpp/src/qpid/amqp_0_10/built_in_types.h2
-rw-r--r--cpp/src/qpid/client/SessionImpl.cpp1
-rw-r--r--cpp/src/qpid/framing/amqp_types.h15
-rwxr-xr-xcpp/src/qpid/sys/IntegerTypes.h31
-rw-r--r--cpp/src/qpid/sys/ProtocolFactory.h2
-rw-r--r--cpp/src/qpid/sys/Socket.h1
-rw-r--r--cpp/src/qpid/sys/Time.h2
-rwxr-xr-xcpp/src/qpid/sys/posix/IntegerTypes.h26
-rwxr-xr-xcpp/src/qpid/sys/windows/IntegerTypes.h40
10 files changed, 108 insertions, 16 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am
index 037a284822..eb5ef7144b 100644
--- a/cpp/src/Makefile.am
+++ b/cpp/src/Makefile.am
@@ -86,7 +86,8 @@ posix_plat_hdr = \
qpid/sys/posix/Mutex.h \
qpid/sys/posix/Fork.h \
qpid/sys/posix/LockFile.h \
- qpid/sys/posix/PollableCondition.h
+ qpid/sys/posix/PollableCondition.h \
+ qpid/sys/posix/IntegerTypes.h
if HAVE_EPOLL
poller = qpid/sys/epoll/EpollPoller.cpp
@@ -268,6 +269,7 @@ libqpidcommon_la_SOURCES = \
qpid/sys/AggregateOutput.cpp \
qpid/sys/AsynchIOHandler.cpp \
qpid/sys/Dispatcher.cpp \
+ qpid/sys/IntegerTypes.h \
qpid/sys/PollableCondition.h \
qpid/sys/PollableQueue.h \
qpid/sys/Runnable.cpp \
diff --git a/cpp/src/qpid/amqp_0_10/built_in_types.h b/cpp/src/qpid/amqp_0_10/built_in_types.h
index 7665d91736..769bedd54e 100644
--- a/cpp/src/qpid/amqp_0_10/built_in_types.h
+++ b/cpp/src/qpid/amqp_0_10/built_in_types.h
@@ -23,6 +23,7 @@
#include "qpid/Serializer.h"
#include "qpid/framing/Uuid.h"
+#include "qpid/sys/IntegerTypes.h"
#include "qpid/sys/Time.h"
#include "Decimal.h"
#include "SerializableString.h"
@@ -31,7 +32,6 @@
#include <string>
#include <ostream>
#include <vector>
-#include <stdint.h>
/**@file Mapping from built-in AMQP types to C++ types */
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp
index 4575c45a35..3d73d92bd4 100644
--- a/cpp/src/qpid/client/SessionImpl.cpp
+++ b/cpp/src/qpid/client/SessionImpl.cpp
@@ -34,6 +34,7 @@
#include "qpid/framing/reply_exceptions.h"
#include "qpid/framing/DeliveryProperties.h"
#include "qpid/log/Statement.h"
+#include "qpid/sys/IntegerTypes.h"
#include <boost/bind.hpp>
diff --git a/cpp/src/qpid/framing/amqp_types.h b/cpp/src/qpid/framing/amqp_types.h
index 8b10aa3069..97b889a7ca 100644
--- a/cpp/src/qpid/framing/amqp_types.h
+++ b/cpp/src/qpid/framing/amqp_types.h
@@ -26,17 +26,8 @@
* in AMQP messages.
*/
+#include "qpid/sys/IntegerTypes.h"
#include <string>
-#ifdef _WINDOWS
-#include "windows.h"
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned __int64 uint64_t;
-#endif
-#ifndef _WINDOWS
-#include <stdint.h>
-#endif
namespace qpid {
namespace framing {
@@ -53,7 +44,7 @@ typedef uint16_t ReplyCode;
class Content;
class FieldTable;
class SequenceNumberSet;
-class Uuid;
+struct Uuid;
// Useful constants
@@ -66,7 +57,7 @@ class FramingContent;
class FieldTable;
class SequenceNumberSet;
class SequenceSet;
-class Uuid;
+struct Uuid;
}} // namespace qpid::framing
#endif
diff --git a/cpp/src/qpid/sys/IntegerTypes.h b/cpp/src/qpid/sys/IntegerTypes.h
new file mode 100755
index 0000000000..89635f033e
--- /dev/null
+++ b/cpp/src/qpid/sys/IntegerTypes.h
@@ -0,0 +1,31 @@
+#ifndef QPID_SYS_INTEGERTYPES_H
+#define QPID_SYS_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.
+ *
+ */
+
+#if (defined(_WINDOWS) || defined (WIN32)) && defined(_MSC_VER)
+#include "qpid/sys/windows/IntegerTypes.h"
+#endif
+#if !defined _WINDOWS && !defined WIN32
+#include "qpid/sys/posix/IntegerTypes.h"
+#endif
+
+#endif /*!QPID_SYS_INTEGERTYPES_H*/
diff --git a/cpp/src/qpid/sys/ProtocolFactory.h b/cpp/src/qpid/sys/ProtocolFactory.h
index 4aa14d2cf6..2a77adc9c4 100644
--- a/cpp/src/qpid/sys/ProtocolFactory.h
+++ b/cpp/src/qpid/sys/ProtocolFactory.h
@@ -22,7 +22,7 @@
*
*/
-#include <stdint.h>
+#include "qpid/sys/IntegerTypes.h"
#include "qpid/SharedObject.h"
#include "ConnectionCodec.h"
#include <boost/function.hpp>
diff --git a/cpp/src/qpid/sys/Socket.h b/cpp/src/qpid/sys/Socket.h
index dd7ef9a96d..ae48b8104d 100644
--- a/cpp/src/qpid/sys/Socket.h
+++ b/cpp/src/qpid/sys/Socket.h
@@ -23,6 +23,7 @@
*/
#include "IOHandle.h"
+#include "qpid/sys/IntegerTypes.h"
#include <string>
diff --git a/cpp/src/qpid/sys/Time.h b/cpp/src/qpid/sys/Time.h
index 6501cd0806..27839e8eb3 100644
--- a/cpp/src/qpid/sys/Time.h
+++ b/cpp/src/qpid/sys/Time.h
@@ -22,7 +22,7 @@
*
*/
-#include <stdint.h>
+#include "qpid/sys/IntegerTypes.h"
#include <limits>
#include <iosfwd>
diff --git a/cpp/src/qpid/sys/posix/IntegerTypes.h b/cpp/src/qpid/sys/posix/IntegerTypes.h
new file mode 100755
index 0000000000..ce97f7bde8
--- /dev/null
+++ b/cpp/src/qpid/sys/posix/IntegerTypes.h
@@ -0,0 +1,26 @@
+#ifndef QPID_SYS_POSIX_INTEGERTYPES_H
+#define QPID_SYS_POSIX_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.
+ *
+ */
+
+#include <stdint.h>
+
+#endif /*!QPID_SYS_INTEGERTYPES_H*/
diff --git a/cpp/src/qpid/sys/windows/IntegerTypes.h b/cpp/src/qpid/sys/windows/IntegerTypes.h
new file mode 100755
index 0000000000..80168fab88
--- /dev/null
+++ b/cpp/src/qpid/sys/windows/IntegerTypes.h
@@ -0,0 +1,40 @@
+#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 socklen_t;
+typedef unsigned int size_t;
+typedef int ssize_t;
+typedef unsigned int uint;
+
+#endif /*!QPID_SYS_WINDOWS_INTEGERTYPES_H*/