Skip to content

Commit 76df84d

Browse files
committed
Next QNX fix attempt: Move all _FILE_defined hackery into ast_std.h
1 parent 5bdf503 commit 76df84d

2 files changed

Lines changed: 11 additions & 26 deletions

File tree

‎src/lib/libast/include/ast.h‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,6 @@
4848
#define PATH_MAX 1024
4949
#endif
5050

51-
/*
52-
* work around botched headers that assume <stdio.h>
53-
*/
54-
55-
#ifndef FILE
56-
#define FILE struct _sfio_s
57-
#ifndef __FILE_typedef
58-
#define __FILE_typedef 1
59-
#endif
60-
#ifndef _FILE_DEFINED
61-
#define _FILE_DEFINED 1
62-
#endif
63-
#ifndef _FILE_defined
64-
#define _FILE_defined 1
65-
#endif
66-
#ifndef _FILEDEFED
67-
#define _FILEDEFED 1
68-
#endif
69-
#ifndef __FILE_defined
70-
#define __FILE_defined 1
71-
#endif
72-
#ifndef ____FILE_defined
73-
#define ____FILE_defined 1
74-
#endif
75-
#endif
76-
7751
/*
7852
* tcc on FreeBSD: Avoid using nonexistent math
7953
* builtins by pretending to be an ancient gcc.

‎src/lib/libast/include/ast_std.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ struct _sfio_s;
6363
#include <ast_fcntl.h>
6464
#include <ast_limits.h>
6565

66+
/*
67+
* Workaround for implementing SFIO's version of FILE*
68+
* (system headers of course assume FILE* is a different type).
69+
*/
70+
6671
#ifdef _SKIP_SFSTDIO_H
6772
#undef _SKIP_SFSTDIO_H
6873
#else
@@ -90,6 +95,12 @@ struct _sfio_s;
9095
#ifndef __DEFINED_FILE
9196
#define __DEFINED_FILE 1
9297
#endif
98+
#ifndef _FILE_DEFINED
99+
#define _FILE_DEFINED 1
100+
#endif
101+
#ifndef _FILE_defined
102+
#define _FILE_defined 1
103+
#endif
93104
#endif
94105

95106
#undef getenv

0 commit comments

Comments
 (0)