SunOS: FOPEN rename to magicFOPEN due to sys/file.h definition

Example build issue using SunOS Solaris solaris 5.11 11.4.42.111.0 i86pc i386
with gcc version 5.5.0 (GCC).

It turns out the definition is not used by the magic codebase.  So only the
macro name is changed by this commit.

This platform also has a definition for FREAD but the MacOS patch can be used
to rename that.

 In file included from DBio.c:51:0:
 ../utils/magic.h:141:0: warning: "FOPEN" redefined
      #define FOPEN    gzopen
  ^
 In file included from DBio.c:30:0:
 /usr/include/sys/file.h:74:0: note: this is the location of the previous definition
  #define FOPEN  0xffffffff
  ^

 In file included from DBio.c:51:0:
 ../utils/magic.h:144:0: warning: "FREAD" redefined
      #define FREAD(a,b,c,d)    gzread(d,a,b*c)
  ^
 In file included from DBio.c:30:0:
 /usr/include/sys/file.h:75:0: note: this is the location of the previous definition
  #define FREAD  0x01 /* <sys/aiocb.h> LIO_READ must be identical */
  ^
This commit is contained in:
Darryl L. Miles 2024-10-17 21:15:30 +01:00 committed by R. Timothy Edwards
parent 778201fbc2
commit 6b0bc5bbdc
1 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ extern char AbortMessage[];
/* ------------ zlib (compression) support -------------------------------- */
#ifdef HAVE_ZLIB
#define FOPEN gzopen
#define magicFOPEN gzopen
#define FCLOSE gzclose
#define FGETC gzgetc
#define magicFREAD(a,b,c,d) gzread(d,a,b*c)
@ -162,7 +162,7 @@ extern char AbortMessage[];
#define FILETYPE gzFile
#define OFFTYPE z_off_t
#else
#define FOPEN fopen
#define magicFOPEN fopen
#define FCLOSE fclose
#define FGETC getc
#define magicFREAD fread