bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] make binary-io.h work with MSVC compiler


From: Bruno Haible
Subject: [Bug-gnulib] make binary-io.h work with MSVC compiler
Date: Mon, 25 Aug 2003 13:07:27 +0200
User-agent: KMail/1.5

Hi,

I've committed this patch. It is necessary on MSVC7 (= MSVS.NET) to avoid an
error that occurs if <stdio.h> is included after "binary-io.h". <stdio.h>
contains a declaration for the function 'fileno' and chokes after we've
defined fileno to _fileno.

2003-08-24  Bruno Haible  <address@hidden>

        * binary-io.h: Include <stdio.h>, to avoid a compilation error when
        MSVC7 <stdio.h> is included later.

diff -c -3 -r1.1 binary-io.h
*** lib/binary-io.h     2 Apr 2003 10:57:23 -0000       1.1
--- lib/binary-io.h     25 Aug 2003 11:04:22 -0000
***************
*** 18,26 ****
  #ifndef _BINARY_H
  #define _BINARY_H
  
- #include <fcntl.h>
  /* For systems that distinguish between text and binary I/O.
     O_BINARY is usually declared in <fcntl.h>. */
  #if !defined O_BINARY && defined _O_BINARY
    /* For MSC-compatible compilers.  */
  # define O_BINARY _O_BINARY
--- 18,31 ----
  #ifndef _BINARY_H
  #define _BINARY_H
  
  /* For systems that distinguish between text and binary I/O.
     O_BINARY is usually declared in <fcntl.h>. */
+ #include <fcntl.h>
+ 
+ /* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...',
+    so we include it here first.  */
+ #include <stdio.h>
+ 
  #if !defined O_BINARY && defined _O_BINARY
    /* For MSC-compatible compilers.  */
  # define O_BINARY _O_BINARY





reply via email to

[Prev in Thread] Current Thread [Next in Thread]