Fix fcgi_streambuf::underflow() such that when there is no buffer
[catagits/fcgi2.git] / libfcgi / fcgi_stdio.c
index 0578d2e..e141e7f 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.12 2001/06/20 16:04:17 robs Exp $";
+static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.14 2001/09/01 01:09:30 robs Exp $";
 #endif /* not lint */
 
 #include <errno.h>  /* for errno */
@@ -26,23 +26,25 @@ static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.12 2001/06/20 16:04:17 robs E
 #include <unistd.h>
 #endif
 
+#ifdef _WIN32
 #define DLLAPI  __declspec(dllexport)
-
-#define NO_FCGI_DEFINES
-#include "fcgi_stdio.h"
-#undef NO_FCGI_DEFINES
+#endif
 
 #include "fcgiapp.h"
 #include "fcgios.h"
 #include "fcgimisc.h"
 
+#define NO_FCGI_DEFINES
+#include "fcgi_stdio.h"
+#undef NO_FCGI_DEFINES
+
 #ifndef _WIN32
 
 extern char **environ;
 
-/* These definitions should be supplied by stdio.h but for some
- * reason they get lost on certain platforms. */
-#ifndef fileno
+#ifdef HAVE_FILENO_PROTO
+#include <stdio.h>
+#else
 extern int fileno(FILE *stream);
 #endif