dtksh: HACKY fix for compilation on later linux C library where FILE definition has moved

This commit is contained in:
Peter Howkins
2018-03-23 01:51:39 +00:00
parent b1c3729e88
commit 9d69ea3d97
12 changed files with 61 additions and 8 deletions

View File

@@ -121,13 +121,7 @@
* workaround botched headers that assume <stdio.h>
*/
#if defined(linux)
#ifndef __FILE
#define __FILE FILE
#endif
#endif
#if !defined(CSRG_BASED)
#if !defined(CSRG_BASED) && !defined(linux)
#ifndef FILE
#define FILE Sfio_t
#endif

View File

@@ -149,7 +149,7 @@
#define _STDIO_INCLUDED 1
#endif
#if !defined(CSRG_BASED)
#if !defined(CSRG_BASED) && !defined(linux)
#ifndef FILE
#define FILE Sfio_t
#endif
@@ -161,6 +161,9 @@
#endif
typedef struct _sfio_ Sfile_t, Sfio_t, SFIO;
#if defined(linux)
typedef struct _sfio_ FILE;
#endif
typedef struct _sfdc_ Sfdisc_t;
typedef int (*Sfread_f)_ARG_((Sfio_t*, Void_t*, int, Sfdisc_t*));
typedef int (*Sfwrite_f)_ARG_((Sfio_t*, const Void_t*, int, Sfdisc_t*));

View File

@@ -50,10 +50,12 @@
#define stdout sfstdout
#define stderr sfstderr
#define BUFSIZ SF_BUFSIZE
#if !defined(linux)
#ifdef FILE
#undef FILE
#endif
#define FILE Sfio_t
#endif
#include <sfio.h>