From: Robert Pengelly Date: Wed, 19 Aug 2026 11:37:17 +0000 (+0100) Subject: Removed C90 limitations and NO_LONG_LONG related stuff as even MinGW on Windows 2000... X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;p=sasm.git Removed C90 limitations and NO_LONG_LONG related stuff as even MinGW on Windows 2000 works --- diff --git a/Makefile.unix b/Makefile.unix index 95c06c7..b9bb589 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -5,7 +5,7 @@ SRCDIR ?= $(CURDIR) VPATH := $(SRCDIR) CC := gcc -CFLAGS := -D_FILE_OFFSET_BITS=64 -O2 -Wall -Werror -Wextra -ansi -pedantic -std=c90 +CFLAGS := -D_FILE_OFFSET_BITS=64 -O2 -Wall -Werror -Wextra CSRC := as.c coff.c cstr.c elks.c expr.c fixup.c frag.c hashtab.c intel.c kwd.c lex.c lib.c list.c listing.c ll.c macro.c process.c report.c section.c symbol.c vector.c diff --git a/expr.h b/expr.h index 509d571..f86a78b 100644 --- a/expr.h +++ b/expr.h @@ -4,7 +4,7 @@ #ifndef _EXPR_H #define _EXPR_H -#include "stdint.h" +#include enum expr_type { diff --git a/fixup.c b/fixup.c index b565cb1..a12ccc7 100644 --- a/fixup.c +++ b/fixup.c @@ -429,7 +429,7 @@ static void adjust_reloc_symbols_of_section (struct section *section) { } -#include "inttypes.h" +#include int64_t machine_dependent_pcrel_from (struct fixup *fixup); int machine_dependent_force_relocation_local (struct fixup *fixup); diff --git a/frag.h b/frag.h index 9df428d..37428b8 100644 --- a/frag.h +++ b/frag.h @@ -4,7 +4,7 @@ #ifndef _FRAG_H #define _FRAG_H -#include "stdint.h" +#include #define RELAX_TYPE_NONE_NEEDED 0 #define RELAX_TYPE_ALIGN 1 diff --git a/intel.c b/intel.c index 8891fb6..51f5c46 100644 --- a/intel.c +++ b/intel.c @@ -4067,10 +4067,6 @@ static int fits_in_unsigned_word (uint64_t number) { return ((number & 0xffff) == number); } -#if defined (NO_LONG_LONG) -# define fits_in_signed_long(x) 1 -# define fits_in_unsigned_long(x) 1 -#else static int fits_in_signed_long (int64_t number) { return ((number >= -2147483647-1) && (number <= 2147483647)); } @@ -4078,7 +4074,6 @@ static int fits_in_signed_long (int64_t number) { static int fits_in_unsigned_long (uint64_t number) { return ((number & 0xffffffff) == number); } -#endif static struct operand_type smallest_imm_type (int64_t number) { diff --git a/inttypes.h b/inttypes.h deleted file mode 100644 index 2ff8fed..0000000 --- a/inttypes.h +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************** - * @file inttypes.h - *****************************************************************************/ -#include - -#if defined (NO_LONG_LONG) -# define I64_FMT "l" -#elif defined (_MSVC_) -# define I64_FMT "I64" -#elif defined (__PRI_64_LENGTH_MODIFIER__) /* Mac */ -# define I64_FMT __PRI_64_LENGTH_MODIFIER__ -#elif (defined (SIZEOF_LONG) && SIZEOF_LONG >= 8) || ((ULONG_MAX >> 16) >> 16) == 0xffffffff -# define I64_FMT "l" -#else -# define I64_FMT "ll" -#endif - -#define PRId64 I64_FMT"d" -#define PRIi64 I64_FMT"i" -#define PRIo64 I64_FMT"o" -#define PRIu64 I64_FMT"u" -#define PRIx64 I64_FMT"x" -#define PRIX64 I64_FMT"X" - diff --git a/listing.c b/listing.c index a8b7c8a..bae6028 100644 --- a/listing.c +++ b/listing.c @@ -132,7 +132,7 @@ void add_listing_message (char *message, const char *filename, unsigned long lin } -#include "inttypes.h" +#include void generate_listing (void) { diff --git a/stdint.h b/stdint.h deleted file mode 100644 index 164c733..0000000 --- a/stdint.h +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** - * @file stdint.h - *****************************************************************************/ -#ifndef _STDINT_H_INCLUDED -#ifndef _STDINT_H -#ifndef _STDINT_H_ - -#define _STDINT_H_INCLUDED -#define _STDINT_H -#define _STDINT_H_ - -#include - -/* Add all data types (even though we don't use them) as the project seems to fail to build on some systems. */ -typedef signed char int8_t; -typedef unsigned char uint8_t; - -typedef signed short int16_t; -typedef unsigned short uint16_t; - -#if INT_MAX > 32767 -typedef signed int int32_t; -typedef unsigned int uint32_t; -#else -typedef signed long int32_t; -typedef unsigned long uint32_t; -#endif - -#ifndef _INT64_T -#define _INT64_T -#if defined (NO_LONG_LONG) || ((ULONG_MAX >> 16) >> 16) == 0xffffffff -typedef signed long int64_t; -#else -typedef signed long long int64_t; -#endif -#endif /* _INT64_T */ - -#ifndef _UINT64_T -#define _UINT64_T -#if defined (NO_LONG_LONG) || ((ULONG_MAX >> 16) >> 16) == 0xffffffff -typedef unsigned long uint64_t; -#else -typedef unsigned long long uint64_t; -#endif -#endif /* _UINT64_T */ - -#endif /* _STDINT_H_ */ -#endif /* _STDINT_H */ -#endif /* _STDINT_H_INCLUDED */ -