Use && and || in preprocessor #if statements. Other minor changes.

git-svn-id: svn://svn.cc65.org/cc65/trunk@866 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-09-08 14:39:01 +00:00
parent def6300556
commit 6e29f555d2
5 changed files with 46 additions and 80 deletions

View File

@@ -39,34 +39,16 @@
/* Load the system specific files here, if needed */ /* Load the system specific files here, if needed */
#ifdef __C64__ #if defined(__C64__) && !defined(_C64_H)
#ifndef _C64_H # include <c64.h>
#include <c64.h> #elif defined(__C128__) && !defined(_C128_H)
#endif # include <c128.h>
#endif #elif defined(__PLUS4__) && !defined(_PLUS4_H)
# include <plus4.h>
#ifdef __C128__ #elif defined(__CBM610__) && !defined(_CBM610_H)
#ifndef _C128_H # include <cbm610.h>
#include <c128.h> #elif defined(__PET__) && !defined(_PET_H)
#endif # include <pet.h>
#endif
#ifdef __PLUS4__
#ifndef _PLUS4_H
#include <plus4.h>
#endif
#endif
#ifdef __CBM610__
#ifndef _CBM610_H
#include <cbm610.h>
#endif
#endif
#ifdef __PET__
#ifndef _PET_H
#include <pet.h>
#endif
#endif #endif
@@ -109,11 +91,16 @@ unsigned char __fastcall__ cbm_k_basin (void);
void __fastcall__ cbm_k_bsout (unsigned char C); void __fastcall__ cbm_k_bsout (unsigned char C);
void __fastcall__ cbm_k_clrch (void); void __fastcall__ cbm_k_clrch (void);
/* BASIC-like functions
/* BASIC-like file I/O functions
* *
* All cbm_* IO functions set extern unsigned char _oserror in case * All cbm_* IO functions set _oserror (see errno.h) in case of an
* of an error. For the meaning of the errorcode see the table below. * error. For the meaning of the errorcode see the table below.
*/ */
unsigned char cbm_load(const char* name, unsigned char device, unsigned char cbm_load(const char* name, unsigned char device,
unsigned int addr); unsigned int addr);
/* Loads file "name" from given device to given address or to the load /* Loads file "name" from given device to given address or to the load
@@ -166,5 +153,9 @@ int cbm_write(unsigned char lfn, void* buffer, unsigned int size);
* 9 = illegal device number * 9 = illegal device number
*/ */
/* End of cbm.h */ /* End of cbm.h */
#endif #endif

View File

@@ -54,27 +54,17 @@
#ifndef _STDARG_H #if !defined(_STDARG_H)
# include <stdarg.h> # include <stdarg.h>
#endif #endif
/* Read the CBM file if we're compiling for a CBM machine */ /* Include the correct machine specific file */
#ifdef __CBM__ #if defined(__CBM__) && !defined(_CBM_H)
# ifndef _CBM_H
# include <cbm.h> # include <cbm.h>
# endif #elif defined(__APPLE2__) && !defined(_APPLE2_H)
#endif
#ifdef __APPLE2__
# ifndef _APPLE2_H
# include <apple2.h> # include <apple2.h>
# endif #elif defined(__ATARI__) && !defined(_ATARI_H)
#endif
#ifdef __ATARI__
# ifndef _ATARI_H
# include <atari.h> # include <atari.h>
# endif
#endif #endif

View File

@@ -67,18 +67,18 @@ int __fastcall__ tolower (int c); /* Always external */
extern unsigned char _ctype[256]; extern unsigned char _ctype[256];
#define isalnum(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$07"), __AX__) #define isalnum(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$07"), __AX__)
#define isalpha(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$03"), __AX__) #define isalpha(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$03"), __AX__)
#define isblank(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$80"), __AX__) #define isblank(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$80"), __AX__)
#define iscntrl(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$10"), __AX__) #define iscntrl(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$10"), __AX__)
#define isdigit(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$04"), __AX__) #define isdigit(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$04"), __AX__)
#define isgraph(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$30\n\tand\t#$30"), __AX__) #define isgraph(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$30\n and #$30"), __AX__)
#define islower(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$01"), __AX__) #define islower(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$01"), __AX__)
#define isprint(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$10\n\tand\t#$10"), __AX__) #define isprint(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$10\n and #$10"), __AX__)
#define ispunct(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$37\n\tand\t#$37"), __AX__) #define ispunct(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n eor #$37\n and #$37"), __AX__)
#define isspace(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$60"), __AX__) #define isspace(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$60"), __AX__)
#define isupper(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$02"), __AX__) #define isupper(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$02"), __AX__)
#define isxdigit(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$08"), __AX__) #define isxdigit(c) (__AX__ = (c), __asm__ ("tay\n lda __ctype,y\n and #$08"), __AX__)

View File

@@ -39,16 +39,7 @@
/* Define __JOYSTICK__ for systems that support a joystick */ /* Define __JOYSTICK__ for systems that support a joystick */
#ifdef __ATARI__ #if defined(__ATARI__) || defined(__C64__) || defined(__C128__) || defined(__PLUS4__)
# define __JOYSTICK__
#endif
#ifdef __C64__
# define __JOYSTICK__
#endif
#ifdef __C128__
# define __JOYSTICK__
#endif
#ifdef __PLUS4__
# define __JOYSTICK__ # define __JOYSTICK__
#endif #endif

View File

@@ -39,13 +39,7 @@
/* Define __MOUSE__ for systems that support a mouse */ /* Define __MOUSE__ for systems that support a mouse */
#ifdef __C64__ #if defined(__ATARI__) || defined(__C64__) || defined(__C128__)
# define __MOUSE__
#endif
#ifdef __C128__
# define __MOUSE__
#endif
#ifdef __ATARI__
# define __MOUSE__ # define __MOUSE__
#endif #endif