add PIC_USE_FILE and PIC_USE_READ flags
This commit is contained in:
@@ -5,12 +5,11 @@
|
||||
/** enable libc */
|
||||
/* #define PIC_USE_LIBC 1 */
|
||||
|
||||
/** enable stdio */
|
||||
/* #define PIC_USE_STDIO 1 */
|
||||
|
||||
/** enable specific features */
|
||||
/* #define PIC_USE_READ 1 */
|
||||
/* #define PIC_USE_WRITE 1 */
|
||||
/* #define PIC_USE_EVAL 1 */
|
||||
/* #define PIC_USE_FILE 1 */
|
||||
|
||||
/** essential external functions */
|
||||
/* #define PIC_JMPBUF jmp_buf */
|
||||
|
||||
@@ -15,8 +15,6 @@ void *pic_default_allocf(void *, void *, size_t);
|
||||
pic_value pic_fopen(pic_state *, FILE *, const char *mode);
|
||||
#endif
|
||||
|
||||
pic_value pic_read(pic_state *, pic_value port);
|
||||
|
||||
/* for debug */
|
||||
|
||||
#if PIC_USE_WRITE
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# define PIC_USE_LIBC 1
|
||||
#endif
|
||||
|
||||
#ifndef PIC_USE_STDIO
|
||||
# define PIC_USE_STDIO 1
|
||||
#ifndef PIC_USE_READ
|
||||
# define PIC_USE_READ 1
|
||||
#endif
|
||||
|
||||
#ifndef PIC_USE_WRITE
|
||||
@@ -20,6 +20,17 @@
|
||||
# define PIC_USE_EVAL 1
|
||||
#endif
|
||||
|
||||
#ifndef PIC_USE_FILE
|
||||
# define PIC_USE_FILE 1
|
||||
#endif
|
||||
|
||||
#if !PIC_USE_READ && PIC_USE_EVAL
|
||||
# error PIC_USE_EVAL requires PIC_USE_READ
|
||||
#endif
|
||||
#if !PIC_USE_LIBC && PIC_USE_FILE
|
||||
# error PIC_USE_FILE requires PIC_USE_LIBC
|
||||
#endif
|
||||
|
||||
#ifndef PIC_JMPBUF
|
||||
# include <setjmp.h>
|
||||
# define PIC_JMPBUF jmp_buf
|
||||
@@ -383,8 +394,11 @@ pic_atod(const char *str)
|
||||
return atof(str);
|
||||
}
|
||||
|
||||
#if PIC_USE_STDIO
|
||||
#if PIC_USE_FILE
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if PIC_USE_LIBC
|
||||
|
||||
PIC_STATIC_INLINE void
|
||||
pic_dtoa(double dval, char *buf)
|
||||
|
||||
Reference in New Issue
Block a user