Re: ISO versions of open(), read(), lseek()
Re: ISO versions of open(), read(), lseek()
- Subject: Re: ISO versions of open(), read(), lseek()
- From: Tom Seddon <email@hidden>
- Date: Tue, 04 Jan 2011 19:38:01 +0000
On Tue, 04 Jan 2011 11:16:39 -0800, Todd Heberlein
<email@hidden> wrote:
>I have to maintain some C++ code between Xcode on a Mac and Visual Studio on Windows, and the Windows compiler kindly encouraged me to use the ISO versions of open(), read(), lseek() and so on (these are _open(), _read(), _lseek() ... (and seem to be defined in io.h)). I was looking for these library calls on the Mac and could not find them.
>
>Are they there somewhere and I just couldn't find them?
>
>If not, are the ISO calls in Apple's public (i.e., non-NDA) "to do" list for future Xcode releases?
I think what VC++ means by "ISO conformant" is that because they don't
support POSIX/Unix/etc., they don't pollute the global namespace with
their extra implementation-defined functions that happen to be a bit
like the POSIX/Unix/etc. equivalents. Instead, they include them with
the "_" prefix that the ISO standard reserves for this kind of thing.
Reasonable enough, but rather inconvenient :)
The easiest option is to get VC++ not to deprecate the unadorned
functions. Put this in your precompiled header:
#define _CRT_NONSTDC_NO_DEPRECATE
or set up "_CRT_NONSTDC_NO_DEPRECATE" as a #define in the Project
Settings.
This should then give you the POSIX/Unix/etc.-style functions under
their usual names. No underscores necessary!
--Tom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden