pkgsrc/emulators/palmosemulator/patches/patch-ap
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

40 lines
1.4 KiB
Text

$NetBSD: patch-ap,v 1.2 2007/10/24 14:28:14 dsainty Exp $
The buffer "buffer" has to be aligned on a 2 byte boundary. On an odd byte
boundary we get the error at startup:
Hardware exception #3 occurred while the emulator was
calling the Palm OS function "DlkDispatchRequest". The
emulator is now in an unstable state and will reset.
An odd byte boundary (and the above error) is typical with gcc 4.1.2 on x86.
--- SrcShared/Miscellaneous.cpp.orig 2002-03-30 01:11:15.000000000 +1200
+++ SrcShared/Miscellaneous.cpp 2007-10-25 02:41:24.000000000 +1300
@@ -1370,7 +1370,7 @@
char buffer[ sizeof (DlpReqHeaderType) +
sizeof (DlpTinyArgWrapperType) +
sizeof (DlpWriteUserInfoReqHdrType) +
- dlpMaxUserNameSize];
+ dlpMaxUserNameSize] __attribute__((__aligned__(2)));
// Get handy pointers to all of the above.
DlpReqHeaderType* reqHdr = (DlpReqHeaderType*) buffer;
@@ -2687,7 +2687,7 @@
// Get the thousands separator character(s).
struct lconv* locale_data = localeconv ();
- char* thousands_sep = locale_data->thousands_sep;
+ const char* thousands_sep = locale_data->thousands_sep;
if (strlen (thousands_sep) == 0)
{
@@ -2747,7 +2747,7 @@
// Get the thousands separator character(s).
struct lconv* locale_data = localeconv ();
- char* thousands_sep = locale_data->thousands_sep;
+ const char* thousands_sep = locale_data->thousands_sep;
if (strlen (thousands_sep) == 0)
{