Removed C90 limitations and NO_LONG_LONG related stuff as even MinGW on Windows 2000... master
authorRobert Pengelly <robertapengelly@hotmail.com>
Wed, 19 Aug 2026 11:36:53 +0000 (12:36 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Wed, 19 Aug 2026 11:36:53 +0000 (12:36 +0100)
Makefile.unix
lib.c
lib.h
ranlib.c
stdint.h [deleted file]

index 46f6d6734509dda3556bd6c578f7dc40d68cdbf0..b1cc3f0dabb97457e0dd2fa6a70b90a3c4807f3c 100644 (file)
@@ -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                :=  append.c ar.c conv.c delete.c display.c extract.c hashtab.c lib.c ranlib.c replace.c report.c
 
diff --git a/lib.c b/lib.c
index 2eea95d0874426be44da23ae06bb0f438adfbaf1..b89ad7cfc8e69fee17818eb4bc9f46ed84ae98e3 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -8,6 +8,7 @@
 #endif
 
 #include    <limits.h>
+#include    <stdint.h>
 #include    <stdio.h>
 #include    <stdlib.h>
 #include    <string.h>
@@ -15,7 +16,6 @@
 #include    "ar.h"
 #include    "lib.h"
 #include    "report.h"
-#include    "stdint.h"
 
 static void print_usage (void) {
 
diff --git a/lib.h b/lib.h
index d9f51cad8247575048ef2ad5acde6bbfccd22834..097465db5bb1d631da26205f8391168b4bd32be5 100644 (file)
--- a/lib.h
+++ b/lib.h
@@ -4,7 +4,7 @@
 #ifndef     _LIB_H
 #define     _LIB_H
 
-#include    "stdint.h"
+#include    <stdint.h>
 
 char *xstrdup (const char *__p);
 char *xstrndup (const char *__p, unsigned long __size);
index 9cd53f8a62efb71a312cdc673e93b28f9d33bf02..79b13763786ffdf173a78dec93d23c9da840892b 100644 (file)
--- a/ranlib.c
+++ b/ranlib.c
@@ -3,6 +3,7 @@
  *****************************************************************************/
 #include    <limits.h>
 #include    <stddef.h>
+#include    <stdint.h>
 #include    <stdio.h>
 #include    <stdlib.h>
 #include    <string.h>
@@ -15,7 +16,6 @@
 #include    "lib.h"
 #include    "macho.h"
 #include    "report.h"
-#include    "stdint.h"
 
 struct strtab {
 
@@ -284,12 +284,7 @@ static void elf64_get_symbols (void *object, int64_t offset, int endianess) {
     
     uint16_t e_shnum = array_to_integer (hdr->e_shnum, 2, endianess);
     uint16_t e_shentsize = array_to_integer (hdr->e_shentsize, 2, endianess);
-    
-#if     defined (NO_LONG_LONG)
-    uint64_t e_shoff = array_to_integer (hdr->e_shoff, 4, endianess);
-#else
     uint64_t e_shoff = array_to_integer (hdr->e_shoff, 8, endianess);
-#endif
     
     uint64_t sh_link, sh_offset, sh_entsize, sh_size;
     uint64_t sym_strtab_size, i, j, st_name;
@@ -310,12 +305,7 @@ static void elf64_get_symbols (void *object, int64_t offset, int endianess) {
         }
         
         sh_link = array_to_integer (shdr.sh_link, 4, endianess);
-        
-#if     defined (NO_LONG_LONG)
-        sh_offset = array_to_integer (shdr.sh_offset, 4, endianess);
-#else
         sh_offset = array_to_integer (shdr.sh_offset, 8, endianess);
-#endif
         
         if (sh_link == 0 || sh_link >= e_shnum) {
             continue;
@@ -327,16 +317,6 @@ static void elf64_get_symbols (void *object, int64_t offset, int endianess) {
             continue;
         }
         
-#if     defined (NO_LONG_LONG)
-        sym_strtab_size = array_to_integer (strtabhdr.sh_size, 4, endianess);
-        sym_strtab = (char *) object + array_to_integer (strtabhdr.sh_offset, 4, endianess);
-        
-        if ((sh_entsize = array_to_integer (shdr.sh_entsize, 4, endianess)) < sizeof (elf_symbol)) {
-            continue;
-        }
-        
-        sh_size = array_to_integer (shdr.sh_size, 4, endianess);
-#else
         sym_strtab_size = array_to_integer (strtabhdr.sh_size, 8, endianess);
         sym_strtab = (char *) object + array_to_integer (strtabhdr.sh_offset, 8, endianess);
         
@@ -345,7 +325,6 @@ static void elf64_get_symbols (void *object, int64_t offset, int endianess) {
         }
         
         sh_size = array_to_integer (shdr.sh_size, 8, endianess);
-#endif
         
         for (j = 1; j < sh_size / sh_entsize; j++) {
         
diff --git a/stdint.h b/stdint.h
deleted file mode 100644 (file)
index 1b97ab8..0000000
--- a/stdint.h
+++ /dev/null
@@ -1,49 +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    <limits.h>
-
-/* 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 */