From 3b03a963754d0edb7782d3ca30bbab3e9322a09c Mon Sep 17 00:00:00 2001 From: mrdudz Date: Mon, 29 Aug 2022 21:06:48 +0200 Subject: [PATCH] add underscores to _poserror and _stroserror --- include/stdio.h | 6 +++++- libsrc/common/_poserror.c | 4 ++-- libsrc/common/stroserr.s | 6 +++--- libsrc/geos-common/common/_poserror.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/stdio.h b/include/stdio.h index 84a991a98..858dd5059 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -147,7 +147,11 @@ int __fastcall__ vfscanf (FILE* f, const char* format, __va_list ap); FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */ int __fastcall__ fileno (FILE* f); /* Unix */ #endif -void __fastcall__ _poserror (const char* msg); /* cc65 */ +void __fastcall__ __poserror (const char* msg); /* cc65 */ +#if __CC65_STD__ == __CC65_STD_CC65__ +/* define old name with one underscore for backwards compatibility */ +#define _poserror __poserror +#endif /* Masking macros for some functions */ #define getc(f) fgetc (f) /* ANSI */ diff --git a/libsrc/common/_poserror.c b/libsrc/common/_poserror.c index 2777fee98..a2a67dd3e 100644 --- a/libsrc/common/_poserror.c +++ b/libsrc/common/_poserror.c @@ -39,10 +39,10 @@ -void __fastcall__ _poserror (const char* msg) +void __fastcall__ __poserror (const char* msg) { /* Fetch the message that corresponds to _oserror */ - const char* errormsg = _stroserror (_oserror); + const char* errormsg = __stroserror (_oserror); /* Different output depending on msg */ if (msg) { diff --git a/libsrc/common/stroserr.s b/libsrc/common/stroserr.s index 25ca30daf..ae8e117f1 100644 --- a/libsrc/common/stroserr.s +++ b/libsrc/common/stroserr.s @@ -1,11 +1,11 @@ ; ; Ullrich von Bassewitz, 17.07.2002 ; -; const char* __fastcall__ _stroserror (unsigned char errcode); +; const char* __fastcall__ __stroserror (unsigned char errcode); ; /* Map an operating system error number to an error message. */ ; - .export __stroserror + .export ___stroserror .import __sys_oserrlist .importzp ptr1, tmp1 @@ -21,7 +21,7 @@ ; and terminated by an entry with length zero that is returned if the ; error code could not be found. -__stroserror: +___stroserror: sta tmp1 ; Save the error code ldy #<__sys_oserrlist diff --git a/libsrc/geos-common/common/_poserror.c b/libsrc/geos-common/common/_poserror.c index eeb3f368e..b47f0a7d9 100644 --- a/libsrc/geos-common/common/_poserror.c +++ b/libsrc/geos-common/common/_poserror.c @@ -9,9 +9,9 @@ #include #include -void __fastcall__ _poserror (const char* msg) +void __fastcall__ __poserror (const char* msg) { - const char *errmsg = _stroserror(_oserror); + const char *errmsg = __stroserror(_oserror); ExitTurbo(); if (msg && *msg) {