mirror of
https://github.com/cc65/cc65.git
synced 2026-04-24 14:17:23 +00:00
The -A and --ansi switches are gone, together with the __STRICT_ANSI__
predefined macro. Instead there is now a command line option --standard that allows to set c89, c99 or cc65 as language standard. The compiler defines a macro __CC65_STD__ that is one of __CC65_STD_C89__, __CC65_STD_C99__ or __CC65_STD_CC65__ depending on the command line option. Default is cc65 (all extensions) as before. git-svn-id: svn://svn.cc65.org/cc65/trunk@3133 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
+20
-16
@@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2000 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 1998-2004 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@@ -70,10 +70,12 @@ int __fastcall__ ispunct (int c);
|
||||
int __fastcall__ isspace (int c);
|
||||
int __fastcall__ isupper (int c);
|
||||
int __fastcall__ isxdigit (int c);
|
||||
#if __CC65_STD__ >= __CC65_STD_C99__
|
||||
int __fastcall__ isblank (int c); /* New in C99 */
|
||||
#endif
|
||||
|
||||
int __fastcall__ toupper (int c); /* Always external */
|
||||
int __fastcall__ tolower (int c); /* Always external */
|
||||
int __fastcall__ toupper (int c); /* Always external */
|
||||
int __fastcall__ tolower (int c); /* Always external */
|
||||
|
||||
|
||||
|
||||
@@ -88,32 +90,34 @@ int __fastcall__ tolower (int c); /* Always external */
|
||||
|
||||
#define isalnum(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_ALNUM), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_ALNUM), \
|
||||
__AX__)
|
||||
|
||||
#define isalpha(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_ALPHA), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_ALPHA), \
|
||||
__AX__)
|
||||
|
||||
#if __CC65_STD__ >= __CC65_STD_C99__
|
||||
#define isblank(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_SPACE_TAB), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_SPACE_TAB), \
|
||||
__AX__)
|
||||
#endif
|
||||
|
||||
#define iscntrl(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_CNTRL), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_CNTRL), \
|
||||
__AX__)
|
||||
|
||||
#define isdigit(c) (__AX__ = (c), \
|
||||
__asm__ ("tay"), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_DIGIT), \
|
||||
__asm__ ("lda %v,y", _ctype), \
|
||||
__asm__ ("and #%b", _CT_DIGIT), \
|
||||
__AX__)
|
||||
|
||||
#define isgraph(c) (__AX__ = (c), \
|
||||
|
||||
+2
-3
@@ -128,7 +128,7 @@ int __fastcall__ vscanf (const char* format, va_list ap);
|
||||
int __fastcall__ vsscanf (const char* s, const char* format, va_list ap);
|
||||
int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap);
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */
|
||||
int __fastcall__ fileno (FILE* f); /* Unix */
|
||||
#endif
|
||||
@@ -141,7 +141,7 @@ void __fastcall__ _poserror (const char* msg); /* cc65 */
|
||||
#define putc(c, f) fputc (c, f) /* ANSI */
|
||||
|
||||
/* Non-standard function like macros */
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
#define flushall() /* Unix */
|
||||
#endif
|
||||
|
||||
@@ -152,4 +152,3 @@ void __fastcall__ _poserror (const char* msg); /* cc65 */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* (C) 1998-2004 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@@ -95,7 +95,7 @@ int system (const char* s);
|
||||
|
||||
/* Non-ANSI functions */
|
||||
void __fastcall__ _swap (void* p, void* q, size_t size);
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
char* __fastcall__ itoa (int val, char* buf, int radix);
|
||||
char* __fastcall__ utoa (unsigned val, char* buf, int radix);
|
||||
char* __fastcall__ ltoa (long val, char* buf, int radix);
|
||||
|
||||
+5
-5
@@ -6,10 +6,10 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2000 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@musoftware.de */
|
||||
/* (C) 1998-2004 Ullrich von Bassewitz */
|
||||
/* Römerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
@@ -70,7 +70,7 @@ void* __fastcall__ memset (void* s, int c, size_t count);
|
||||
void* __fastcall__ _bzero (void* ptr, size_t n);
|
||||
|
||||
/* Non standard: */
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __CC65_STD__ == __CC65_STD_CC65__
|
||||
void __fastcall__ bzero (void* ptr, size_t n); /* BSD */
|
||||
char* __fastcall__ strdup (const char* s); /* SYSV/BSD */
|
||||
int __fastcall__ stricmp (const char* s1, const char* s2); /* DOS/Windows */
|
||||
|
||||
Reference in New Issue
Block a user