You are absolutely right. I took a look into fcntl.h and there it was.

Apparently my configure script is defining NO_OLDNAMES and not defining
_POSIX. I dunno why. But the  _O_BINARY option works just fine and allows
me to avoid the hack with fopen/fileno.

Thanks a bunch. Now I can go ahead and release http://dbh.sf.net 5.0.8 for
windows sometime during the next few days.


2013/10/16 Ozkan Sezer <seze...@gmail.com>

> On 10/16/13, Edscott Wilson <edscott.wilson.gar...@gmail.com> wrote:
> > 2013/10/16 Ruben Van Boxem <vanboxem.ru...@gmail.com>
> >
> >> 2013/10/16 Edscott Wilson <edscott.wilson.gar...@gmail.com>
> >>
> >>>
> >>> I appreciate all the responses. This is the result.
> >>>
> >>> 1. The option O_BINARY is not available in fcntl.h for gcc, So
> >>> open("test.dbh", O_RDWR|O_BINARY) does not work.
> >>>
> >>
> >> See MSDN for the flags you are looking for:
> >> http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
> >>
> >>
> >>
> > The problem with that is I want to use mingw-64's gcc, and gcc does not
> > define O_BINARY, and does not seem likely that it will in the future.
> Maybe
> > the mingw port should include O_BINARY and O_TEXT.
>
> gcc itself doesn't define O_BINARY, but fcntl.h from mingw[-w64]
> projects *do* define it: make sure that you include fcntl.h.
> If for some weird reason you are defining NO_OLDNAMES or something,
> then use _O_BINARY with the leading underscore.
>
> --
> O.S.
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>



-- 
------------------------------------------------------------------------------------
Dr. Edscott Wilson Garcia
Applied Mathematics and Computing
Mexican Petroleum Institute
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to