|
Boost : |
Subject: Re: [boost] Proposed templated integer_sort
From: Steven Ross (spreadsort_at_[hidden])
Date: 2009-04-18 14:59:35
I'm using #ifdef MSVC to set MAX_SPLITS to a different value on Windows
MSVC.
I'm currently working on making my samples run cleanly without warnings on
Windows. fopen gives warnings in MSVC (see below), and I've run into file
I/O errors on Windows (which do not occur on Linux). Here are some Windows
compile warnings with fopen:
samples\alreadysorted.cpp(34) : warning C4996: 'fopen': This function or
variable may be unsafe. Consider using fopen_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Microsoft Visual Studio
8\VC\INCLUDE\stdio.h(234) : see declaration of 'fopen'
samples\alreadysorted.cpp(65) : warning C4996: 'fopen': This function or
variable may be unsafe. Consider using fopen_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Microsoft Visual Studio
8\VC\INCLUDE\stdio.h(234) : see declaration of 'fopen'
samples\alreadysorted.cpp(67) : warning C4996: 'fopen': This function or
variable may be unsafe. Consider using fopen_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Microsoft Visual Studio
8\VC\INCLUDE\stdio.h(234) : see declaration of 'fopen'
What is the best platform-independent file I/O approach to use for writing
and reading bytes? ofstream writes 4031 bytes when I tell it to write 4000
on Windows, so that doesn't seem appropriate.
On Wed, Feb 11, 2009 at 7:48 PM, Michael Marcin <mike.marcin_at_[hidden]>wrote:
> Steven Ross wrote:
> > Questions:
>
>> 1) Is it a good idea to automatically detect the OS, and for windows set
>> MAX_SPLITS to 16, and for all other OSes set it to 10?
>>
>
> Yes
>
> --
> Michael Marcin
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk