* device/include/asm/default/features.h,
[fw/sdcc] / device / include / math.h
index ce084d039db53e8afe0ac477e5ad6097d92afc56..fe56342333a41bb3b281f2c8a9429f1b24272a4e 100644 (file)
@@ -42,12 +42,20 @@ union float_long
     long l;
 };
 
+#if defined(SDCC_MATH_LIB) && defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK) && !defined(SDCC_STACK_AUTO) && !defined(_SDCC_NO_ASM_LIB_FUNCS)
+// Compile the mcs51 assembly version only when all these
+// conditions are met.  Since not all the functions are
+// reentrant, do not compile with --stack-auto is used.
+#define MATH_ASM_MCS51
+#endif
+
+
 /* Functions on the z80 & gbz80 are always reentrant and so the "reentrant" */
 /* keyword is not defined. */
 #if defined(SDCC_z80) || defined(SDCC_gbz80)
 #define _FLOAT_FUNC_REENTRANT
 #else
-#define _FLOAT_FUNC_REENTRANT reentrant
+#define _FLOAT_FUNC_REENTRANT __reentrant
 #endif
 
 /**********************************************