gcc on osx seems to balk at "extern __inline ssize_t..." (7)

1 Name: #!/usr/bin/anonymous : 2008-01-26 19:29 ID:5qSitdLW

I have some old C code (originally written for linux) that I'm trying to compile on osx. I don't have a lot of experience with big C programs; there's no documentation, and the devs are all gone away, so I've been struggling with it --- anyway, when I try to make, it gives the following errors before crapping out:

dprintf.h:16: error: parse error before 'saferead'
dprintf.h:16: warning: type defaults to 'int' in declaration of 'saferead'
dprintf.h:16: warning: data definition has no type or storage class
dprintf.h:17: error: parse error before 'safewrite'
dprintf.h:17: warning: type defaults to 'int' in declaration of 'safewrite'
dprintf.h:17: warning: data definition has no type or storage class
make[2]: *** [dperc.o] Error 1
rm DDataDescrip.o
make[1]: *** [dprintf] Error 2
make: *** [all] Error 255

Here's the offending header file. It looks okay to me, but maybe someone more experienced here will spot something amiss:

#ifndef _DPRINTF_H
#define _DPRINTF_H
#include "dprintf/dprintf_defs.h"
/* 
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
*
* Created: Sat Jan 26 19:07:06 2008
*/
#ifndef __CEXTRACT__
#if __STDC__
extern int dperc ( int dbl );
extern void dprintf ( short dlevel, char *fmt, ... );
extern __inline ssize_t saferead ( int fd, void *buf, size_t count );
extern __inline ssize_t safewrite ( int fd, void *buf, size_t count );
#endif /* __STDC__ */
#endif /* __CEXTRACT__ */
/*
* This part was generated from DDataDescrip.c
* Sat Jan 26 19:07:05 GMT 2008
*/
extern short    debug_level;
extern int perc_tot;
extern int perc_num;
extern long n_alloc;
#endif /* _DPRINTF_H */

2 Name: #!/usr/bin/anonymous : 2008-01-26 21:34 ID:Heaven

"__inline" is not a C keyword.

3 Name: #!/usr/bin/anonymous : 2008-02-09 19:45 ID:Heaven

Replace __inline with inline and compile with -std=C99.

4 Name: #!/usr/bin/anonymous : 2008-03-03 02:38 ID:nucJFHOF

gcc recognizes __inline with or without -std=c99

you forgot to #include the header for ssize_t

5 Name: #!/usr/bin/anonymous : 2008-03-03 13:44 ID:Heaven

<unistd.h>

or

<sys/types.h>

6 Name: #!/usr/bin/anonymous : 2008-03-03 13:46 ID:Heaven

Also, if your implementation does not provide ssize_t do
typedef long ssize_t;

7 Post deleted.

This thread has been closed. You cannot post in this thread any longer.