* config.dsp: added dependency on .version and configure_vc.awk
[fw/sdcc] / device / include / setjmp.h
index 6742bb89788ec92708c9bed1200acfd4e00b86c3..866e694434309a538decd487dac893bbe4b219bc 100644 (file)
 #ifndef SDCC_SETJMP_H
 #define SDCC_SETJMP_H
 
-typedef unsigned char jmp_buf[3];
+#define SP_SIZE                1
 
-int setjmp (unsigned char *);
-int longjmp(unsigned char *, int);
+#ifdef SDCC_STACK_AUTO
+#define BP_SIZE                SP_SIZE
+#else
+#define BP_SIZE                0
+#endif
+
+#ifdef SDCC_USE_XSTACK
+#define SPX_SIZE       1
+#else
+#define SPX_SIZE       0
+#endif
+
+#define BPX_SIZE       SPX_SIZE
+
+#define RET_SIZE       2
+
+typedef unsigned char jmp_buf[RET_SIZE + SP_SIZE + BP_SIZE + SPX_SIZE + BPX_SIZE];
+
+int setjmp (jmp_buf);
+int longjmp(jmp_buf, int);
+
+#undef RET_SIZE
+#undef SP_SIZE
+#undef BP_SIZE
+#undef SPX_SIZE
+#undef BPX_SIZE
 
 #endif