Post Reply 
WP-34S --> WP-30S: Reduce / Reuse / Repurpose
02-05-2014, 04:39 AM (This post was last modified: 01-21-2015 12:16 AM by Bit.)
Post: #16
RE: WP-34S --> WP-30S: Reduce / Reuse / Repurpose
(02-05-2014 03:23 AM)Sanjeev Visvanatha Wrote:  This is throwing a few errors. Being pretty inexperienced in this area, does anyone have some ideas / pointers I could try?
I ran into this, too. The types in stdint.h conflict with some of the types declared in the WP 34S source. The right thing to do would be to modify the WP 34S source so it doesn't try to override standard types if stdint.h is available, but I haven't yet gotten around to creating a proper fix.

However, the below patch contains some ugly hacks that'll allow you to get past this problem. (You'll probably have to revert the patch before trying to compile the emulator in the same source tree.) The patch also provides the pointers you asked for in case you'd like to work on a better solution.

Code:
diff -ur wp34s-code_revision-3470_20140127_original/Makefile wp34s-code_revision-3470_20140127_integer_type_fix/Makefile
--- wp34s-code_revision-3470_20140127_original/Makefile    2014-01-27 21:38:32.991789124 -0500
+++ wp34s-code_revision-3470_20140127_integer_type_fix/Makefile    2014-02-04 23:28:16.336463245 -0500
@@ -31,7 +31,7 @@
 #INFRARED = 1
 endif
 
-BASE_CFLAGS := -Wall -Werror -g -fno-common -fno-exceptions 
+BASE_CFLAGS := -Wall -Werror -g -fno-common -fno-exceptions -DINT32_IS_LONG
 OPT_CFLAGS := -Os -fira-region=one
 USE_CURSES := -DUSECURSES
 
diff -ur wp34s-code_revision-3470_20140127_original/decNumber/decContext.h wp34s-code_revision-3470_20140127_integer_type_fix/decNumber/decContext.h
--- wp34s-code_revision-3470_20140127_original/decNumber/decContext.h    2014-01-27 21:38:32.691789132 -0500
+++ wp34s-code_revision-3470_20140127_integer_type_fix/decNumber/decContext.h    2014-02-04 23:28:16.332463246 -0500
@@ -38,11 +38,19 @@
 
 typedef signed char        int8_t;
 typedef short int        int16_t;
+#ifndef INT32_IS_LONG
 typedef int            int32_t;
+#else
+typedef long            int32_t;
+#endif
 typedef long long int        integer64_t;
 typedef unsigned char        uint8_t;
 typedef unsigned short int    uint16_t;
+#ifndef INT32_IS_LONG
 typedef unsigned int        uint32_t;
+#else
+typedef unsigned long        uint32_t;
+#endif
 #ifdef FIX_LINUX_64_BITS
 typedef unsigned long int    uint64_t;
 #else
diff -ur wp34s-code_revision-3470_20140127_original/xeq.c wp34s-code_revision-3470_20140127_integer_type_fix/xeq.c
--- wp34s-code_revision-3470_20140127_original/xeq.c    2014-01-27 21:38:32.995789124 -0500
+++ wp34s-code_revision-3470_20140127_integer_type_fix/xeq.c    2014-02-04 23:28:16.336463245 -0500
@@ -3443,7 +3443,7 @@
  *  Fix the pointer alignment on the go.
  */
 #ifdef REALBUILD
-typedef unsigned long uintptr_t;
+typedef unsigned uintptr_t;
 #else
 #include <stdint.h>
 #endif
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: WP-34S --> WP-30S: Reduce / Reuse / Repurpose - Bit - 02-05-2014 04:39 AM



User(s) browsing this thread: 21 Guest(s)