Andy Dougherty wrote:
I tried to take a quick look at the embed_api2 branch. It failed with the
strange-looking error message:
"./include/parrot/api.h", line 241: syntax error before or at:&
Ultimately, the problem is that it is using 'stdin', 'stderr', and
'stdout' as variable names, when<stdio.h> (or some file included by that)
has already #defined them. On Solaris 10, for example, you get
#define stdin (&__iob[0])
#define stdout (&__iob[1])
#define stderr (&__iob[2])
(which explains the odd reference to '&' in the error message).
Simply renaming the variables to something like 'mystdin', etc.,
should make that problem go away.
I was testing the embed_api2 branch on Darwin this weekend and came to
the same conclusion. Last night I sent the attached file to
whiteknight; I guess now it will be good for everyone to see it. It
compares the content of /usr/include/stdin.h on my Linux (Debian) and
Darwin (OS X 10.4) machines.
kid51
From /usr/include/stdin.h on Linux:
144 /* Standard streams. */
145 extern struct _IO_FILE *stdin; /* Standard input stream. */
146 extern struct _IO_FILE *stdout; /* Standard output stream. */
147 extern struct _IO_FILE *stderr; /* Standard error output stream. */
148 /* C89/C99 say they're macros. Make them happy. */
149 #define stdin stdin
150 #define stdout stdout
151 #define stderr stderr
From /usr/include/stdin.h on Darwin:
165 __BEGIN_DECLS
166 #if __DARWIN_UNIX03
167 extern FILE *__stdinp;
168 extern FILE *__stdoutp;
169 extern FILE *__stderrp;
170 #else /* !__DARWIN_UNIX03 */
171 extern FILE __sF[];
172 #endif /* __DARWIN_UNIX03 */
173 __END_DECLS
...
235 #if __DARWIN_UNIX03
236 #define stdin __stdinp
237 #define stdout __stdoutp
238 #define stderr __stderrp
239 #else /* !__DARWIN_UNIX03 */
240 #define stdin (&__sF[0])
241 #define stdout (&__sF[1])
242 #define stderr (&__sF[2])
243 #endif /* __DARWIN_UNIX03 */
Hypothesis: Could the '&' in lines 240-42 be the '&' about which 'make' is
complaining when it hits src/embed/api.c?_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev