Don't provide printf_fast, printf_fast_f and printf_tiny on architectures
authorpjs <pjs@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 28 Dec 2004 21:54:28 +0000 (21:54 +0000)
committerpjs <pjs@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 28 Dec 2004 21:54:28 +0000 (21:54 +0000)
they don't support (eg, with --xstack).
Don't compile shared asm float helper functions when asm float lib not
enabled.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3619 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/include/stdio.h
device/lib/_fsget1arg.c
device/lib/_fsget2args.c
device/lib/_fsnormalize.c
device/lib/_fsreturnval.c
device/lib/_fsrshift.c
device/lib/_fsswapargs.c
device/lib/printf_fast.c
device/lib/printf_fast_f.c
device/lib/printf_tiny.c

index 84473337688237859d5e50372e566247d6608031..f6d03c72686e1d97faa07fedf1bc9f98d82ed9d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-12-28 Paul Stoffregen <paul AT pjrc.com>
+
+       * device/lib/printf_fast.c: only build on supported arch.
+       * device/lib/printf_tiny.c: only build on supported arch.
+       * device/lib/printf_fast_f.c: only build if asm float lib
+       * device/lib/_fsget1arg.c: only build if asm float lib
+       * device/lib/_fsget2args.c: only build if asm float lib
+       * device/lib/_fsnormalize.c: only build if asm float lib
+       * device/lib/_fsreturnval.c: only build if asm float lib
+       * device/lib/_fsrshift.c: only build if asm float lib
+       * device/lib/_fsswapargs.c: only build if asm float lib
+       * device/include/stdio.h: don't provide print_fast,
+         print_fast_f, print_tiny prototypes if --xstack used
+
 2004-12-28 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * device/lib/sincosf.c (sincosf): don't invert bit/bool by ~
index d96ebc2883ea5d35237f1c4ac0431bd6a251c2bb..d02c5eb1c133f2189325ebda66bf9491a24a1bd8 100644 (file)
@@ -58,7 +58,7 @@ extern char *gets(char *);
 extern char getchar(void);
 extern void putchar(char);
 
-#ifdef __mcs51
+#if defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK)
 extern void printf_fast(code char *fmt, ...) _REENTRANT;
 extern void printf_fast_f(code char *fmt, ...) _REENTRANT;
 extern void printf_tiny(code char *fmt, ...) _REENTRANT;
index abf17260ef0cca4a97555ad83d87be9fbc33ac19..f55554b526226a37fdb570d6fdc03ad8ab3c1a2e 100644 (file)
@@ -21,6 +21,8 @@
 #include <float.h>
 
 
+#ifdef FLOAT_ASM_MCS51
+
 static void dummy(void) _naked
 {
        // input passed in a,b,dph,dpl
@@ -46,6 +48,6 @@ fsgetarg:
        _endasm;
 }
 
-
+#endif
 
 
index 404b8ad11f4c4899579ef61394b462a3d7879074..d386be05d23ea0873cce602993f082d92c0a36f5 100644 (file)
@@ -22,7 +22,7 @@
 #include <float.h>
 
 
-
+#ifdef FLOAT_ASM_MCS51
 
 static void dummy(void) _naked
 {
@@ -72,6 +72,7 @@ fsgetargs:
        _endasm;
 }
 
+#endif
 
 
 
index f404452cc8bfb82898c1eeab1d7b3180b784ac94..4eeeca96eeeae51800574ffb1d9cd28be2923e33 100644 (file)
@@ -21,6 +21,9 @@
 #define SDCC_FLOAT_LIB
 #include <float.h>
 
+
+#ifdef FLOAT_ASM_MCS51
+
 static void dummy(void) _naked
 {
        _asm
@@ -70,3 +73,6 @@ fs_normalize_a:
        ret
        _endasm;
 }
+
+#endif
+
index 798f934b7765aaf96181b5ae9a6200afbe30ac7d..6dfc85cf450916922354e435a5ca6a8db77538b1 100644 (file)
@@ -21,6 +21,9 @@
 #define SDCC_FLOAT_LIB
 #include <float.h>
 
+
+#ifdef FLOAT_ASM_MCS51
+
 static void dummy(void) _naked
 {
        _asm
@@ -99,3 +102,5 @@ fs_return_nan:
        _endasm;
 }
 
+#endif
+
index 5e7e7e90ae5870ab032262fc917a715250aed73c..1f32f26a6d1e5b8d626e7fbe73cdbc754e7bc6a6 100644 (file)
@@ -22,6 +22,8 @@
 #include <float.h>
 
 
+#ifdef FLOAT_ASM_MCS51
+
 static void dummy(void) _naked
 {
        _asm
@@ -95,3 +97,5 @@ fs_rshift_a:
        _endasm;
 }
 
+#endif
+
index 85404cb4368601360cd8ffbd62be34bfd5f5c8fa..d2573b0275b697620acc1af335d72be557b17f92 100644 (file)
@@ -21,6 +21,9 @@
 #define SDCC_FLOAT_LIB
 #include <float.h>
 
+
+#ifdef FLOAT_ASM_MCS51
+
 static void dummy(void) _naked
 {
        _asm
@@ -53,3 +56,5 @@ fs_swap_a_b:
        _endasm;
 }
 
+#endif
+
index 698f9fa1b9e7d699c5e4dbf4fe673ffee2e636e7..1db100827710ce1ff0e0bf9473662a03f1aae361 100644 (file)
@@ -119,6 +119,18 @@ static data unsigned int i2bcd_tmp;  // slow 32 int conversion needs temp space
 #define PRINTF_FAST printf_fast
 #endif
 
+
+#if !defined(SDCC_mcs51) || defined(SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS)
+// Does printf_fast really work on ds390 and ds400?
+// If it does, enable them in the line above
+#if defined(SDCC_USE_XSTACK)
+#warning "printf_fast not built, does not support --xstack"
+#elif defined(_SDCC_NO_ASM_LIB_FUNCS)
+#warning "printf_fast not built, _SDCC_NO_ASM_LIB_FUNCS defined"
+#endif
+#else // defines are compatible with printf_fast
+
+
 void PRINTF_FAST(code char *fmt, ...) reentrant
 {
        fmt;    /* supress unreferenced variable warning */
@@ -1735,5 +1747,5 @@ static code unsigned char frac2bcd[] = {
 #endif // FLOAT
 
 
-
+#endif // defines compatible with printf_fast
 
index eb91459212bd62a819a3765176e38e4012f9989e..c2504a65f654f33387f9fb8057a0a9f5d334d5a9 100644 (file)
@@ -1,7 +1,13 @@
 // Same as printf_fast, but with floating point enabled
 
+#define SDCC_FLOAT_LIB
+#include <float.h>
+
+#ifdef FLOAT_ASM_MCS51
+
 #define FLOAT
 #define PRINTF_FAST printf_fast_f
 
 #include "printf_fast.c"
 
+#endif
index 4a6dfd4d9e265e9ed9f3d1fa6928a9f11d4875ac..4db9fe4fcfc78b269ffec436d41091143523f346 100644 (file)
 #define print_zero_flag PSW.5
 
 
+#if !defined(SDCC_mcs51) || defined(SDCC_USE_XSTACK) || defined(_SDCC_NO_ASM_LIB_FUNCS)
+// Does printf_tiny really work on ds390 and ds400?
+// If it does, enable them in the line above
+#if defined(SDCC_USE_XSTACK)
+#warning "printf_tiny not built, does not support --xstack"
+#elif defined(_SDCC_NO_ASM_LIB_FUNCS)
+#warning "printf_tiny not built, _SDCC_NO_ASM_LIB_FUNCS defined"
+#endif
+#else // defines are compatible with printf_tiny
+
+
+
 void printf_tiny(code char *fmt, ...) reentrant
 {
        fmt;    /* supress unreferenced variable warning */
@@ -273,3 +285,5 @@ printf_end:
 }
 
 
+#endif // defines compatible with printf_tiny
+