1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
Description: Fix FTBFS on various arches caused by buggy oscpack build
OscTypes.h: fix integer size detection on 64-bit arches
OscReceivedElements.cpp:
- Fix "error: 'argument_' was not declared in this scope" on big-endian
arches.
- Rename RoundUp4 to avoid multiple redefinitions on platforms where
uint32 == size_t. This bug originally happened on 64-bit arches due to the
mishandling of types in OscTypes.h.
OscOutboundPacketStream.h, OscReceivedElements.h:
- Remove extra int overloads which don't built on 32-bit arches.
The other overloads should be enough.
Author: James Cowgill <jcowgill@debian.org>
Bug-Debian: https://bugs.debian.org/824581
Forwarded: yes
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/external_libraries/oscpack_1_1_0/osc/OscTypes.h
+++ b/external_libraries/oscpack_1_1_0/osc/OscTypes.h
@@ -37,42 +37,17 @@
#ifndef INCLUDED_OSCPACK_OSCTYPES_H
#define INCLUDED_OSCPACK_OSCTYPES_H
+#include <stdint.h>
namespace osc{
// basic types
-#if defined(__BORLANDC__) || defined(_MSC_VER)
-
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
-
-#elif defined(__x86_64__) || defined(_M_X64)
-
-typedef long int64;
-typedef unsigned long uint64;
-
-#else
-
-typedef long long int64;
-typedef unsigned long long uint64;
-
-#endif
-
-
-
-#if defined(__x86_64__) || defined(_M_X64)
-
-typedef signed int int32;
-typedef unsigned int uint32;
-
-#else
-
-typedef signed long int32;
-typedef unsigned long uint32;
-
-#endif
+typedef int64_t int64;
+typedef uint64_t uint64;
+typedef int32_t int32;
+typedef uint32_t uint32;
enum ValueTypeSizes{
OSC_SIZEOF_INT32 = 4,
--- a/external_libraries/oscpack_1_1_0/osc/OscReceivedElements.cpp
+++ b/external_libraries/oscpack_1_1_0/osc/OscReceivedElements.cpp
@@ -84,7 +84,7 @@ static inline const char* FindStr4End( c
// round up to the next highest multiple of 4. unless x is already a multiple of 4
-static inline uint32 RoundUp4( uint32 x )
+static inline uint32 RoundUp4_UInt32( uint32 x )
{
return (x + 3) & ~((uint32)0x03);
}
@@ -249,7 +249,7 @@ int32 ReceivedMessageArgument::AsInt32Un
return u.i;
#else
- return *(int32*)argument_;
+ return *(int32*)argumentPtr_;
#endif
}
@@ -280,7 +280,7 @@ float ReceivedMessageArgument::AsFloatUn
return u.f;
#else
- return *(float*)argument_;
+ return *(float*)argumentPtr_;
#endif
}
@@ -400,7 +400,7 @@ double ReceivedMessageArgument::AsDouble
return u.d;
#else
- return *(double*)argument_;
+ return *(double*)argumentPtr_;
#endif
}
@@ -533,7 +533,7 @@ void ReceivedMessageArgumentIterator::Ad
{
// treat blob size as an unsigned int for the purposes of this calculation
uint32 blobSize = ToUInt32( value_.argumentPtr_ );
- value_.argumentPtr_ = value_.argumentPtr_ + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize );
+ value_.argumentPtr_ = value_.argumentPtr_ + osc::OSC_SIZEOF_INT32 + RoundUp4_UInt32( blobSize );
}
break;
@@ -694,7 +694,7 @@ void ReceivedMessage::Init( const char *
// treat blob size as an unsigned int for the purposes of this calculation
uint32 blobSize = ToUInt32( argument );
- argument = argument + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize );
+ argument = argument + osc::OSC_SIZEOF_INT32 + RoundUp4_UInt32( blobSize );
if( argument > end )
MalformedMessageException( "arguments exceed message size" );
}
--- a/external_libraries/oscpack_1_1_0/osc/OscOutboundPacketStream.h
+++ b/external_libraries/oscpack_1_1_0/osc/OscOutboundPacketStream.h
@@ -105,11 +105,6 @@ public:
OutboundPacketStream& operator<<( const InfinitumType& rhs );
OutboundPacketStream& operator<<( int32 rhs );
-#if !(defined(__x86_64__) || defined(_M_X64))
- OutboundPacketStream& operator<<( int rhs )
- { *this << (int32)rhs; return *this; }
-#endif
-
OutboundPacketStream& operator<<( float rhs );
OutboundPacketStream& operator<<( char rhs );
OutboundPacketStream& operator<<( const RgbaColor& rhs );
--- a/external_libraries/oscpack_1_1_0/osc/OscReceivedElements.h
+++ b/external_libraries/oscpack_1_1_0/osc/OscReceivedElements.h
@@ -100,12 +100,6 @@ public:
: contents_( contents )
, size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {}
-#if !(defined(__x86_64__) || defined(_M_X64))
- ReceivedPacket( const char *contents, int size )
- : contents_( contents )
- , size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {}
-#endif
-
bool IsMessage() const { return !IsBundle(); }
bool IsBundle() const;
|