pkgsrc/emulators/palmosemulator/patches/patch-ar
dsainty c953b732ac Fix the build of the Palm OS Emulator with GCC 4.1.2.
patch-ar was sourced from http://www.freebsd.org/cgi/cvsweb.cgi/ports/palm/pose/files/patch-SrcShared-EmPalmStructs.h

Changes to patch-ap were determined by getting gcc 3.4 and gcc 4.1.2 to
fight until the bug was forced to reveal itself!

Don't need to bump the revision.  Either it built under gcc 3 and worked, or
didn't build at all under gcc 4.

Addresses PR pkg/37188.
2007-10-24 14:28:14 +00:00

32 lines
1.8 KiB
Text

$NetBSD: patch-ar,v 1.1 2007/10/24 14:28:14 dsainty Exp $
Fix build with gcc41.
--- SrcShared/EmPalmStructs.h.orig Thu Oct 5 15:19:20 2006
+++ SrcShared/EmPalmStructs.h Thu Oct 5 15:19:43 2006
@@ -577,9 +577,9 @@
template <class A> \
INLINE_ EmAlias##type<A>& EmAlias##type<A>::operator= (rhs_type val) \
{ \
- if (sizeof (asType) == 1) A::PutByte (this->GetPtr (), (unsigned char) (asType) val); \
- else if (sizeof (asType) == 2) A::PutWord (this->GetPtr (), (unsigned short) (asType) val); \
- else if (sizeof (asType) == 4) A::PutLong (this->GetPtr (), (unsigned long) (asType) val); \
+ if (sizeof (asType) == 1) A::PutByte (this->GetPtr (), (unsigned char) (asType) (long) val); \
+ else if (sizeof (asType) == 2) A::PutWord (this->GetPtr (), (unsigned short) (asType) (long) val); \
+ else if (sizeof (asType) == 4) A::PutLong (this->GetPtr (), (unsigned long) (asType) (long) val); \
else BadSetter (); \
\
return *this; \
@@ -589,9 +589,9 @@
\
INLINE_ EmProxy##type& EmProxy##type::operator= (rhs_type val) \
{ \
- if (sizeof (asType) == 1) LAS::PutByte (this->GetPtr (), (unsigned char) (asType) val); \
- else if (sizeof (asType) == 2) LAS::PutWord (this->GetPtr (), (unsigned short) (asType) val); \
- else if (sizeof (asType) == 4) LAS::PutLong (this->GetPtr (), (unsigned long) (asType) val); \
+ if (sizeof (asType) == 1) LAS::PutByte (this->GetPtr (), (unsigned char) (asType) (long) val); \
+ else if (sizeof (asType) == 2) LAS::PutWord (this->GetPtr (), (unsigned short) (asType) (long) val); \
+ else if (sizeof (asType) == 4) LAS::PutLong (this->GetPtr (), (unsigned long) (asType) (long) val); \
else BadSetter (); \
\
return *this; \