This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH 64bit] Export <io.h> symbols with underscore
On Fri, 22 Feb 2013 09:49:51 +0100, Corinna Vinschen wrote:
> > access should go, no doubt about it.
> >
> > For get_osfhandle and setmode I would prefer maintaining backward
> > compatibility with existing applications. Both variations, with and
> > without underscore are definitely in use.
> >
> > What about exporting the underscored variants only, but define the
> > non-underscored ones:
> >
> > extern long _get_osfhandle(int);
> > #define get_osfhandle(i) _get_osfhandle(i)
> >
> > extern int _setmode (int __fd, int __mode);
> > #define setmode(f,m) _setmode((f),(m))
>
> Just to be clear: On 32 bit we should keep the exported symbols, too.
> On 64 bit we can drop the non-underscored ones (which just requires
> to rebuild gawk for me) and only keep the defines for backward
> compatibility.
Like this?
Yaakov
2013-02-22 Yaakov Selkowitz <yselkowitz@...>
Corinna Vinschen <corinna@...>
* cygwin64.din (_get_osfhandle): Rename from get_osfhandle.
(_setmode): Rename from setmode.
* include/io.h: Ditto. Define unprefixed names with preprocessor
macros for backwards source compatibility.
(access): Remove.
* syscalls.cc (get_osfhandle): Undefine compatibility macro.
Index: cygwin64.din
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Attic/cygwin64.din,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 cygwin64.din
--- cygwin64.din 15 Feb 2013 13:36:36 -0000 1.1.2.7
+++ cygwin64.din 22 Feb 2013 09:26:46 -0000
@@ -437,7 +437,7 @@ get_avphys_pages SIGFE
get_current_dir_name SIGFE
get_nprocs SIGFE
get_nprocs_conf SIGFE
-get_osfhandle SIGFE
+_get_osfhandle = get_osfhandle SIGFE
get_phys_pages SIGFE
getaddrinfo = cygwin_getaddrinfo SIGFE
getc SIGFE
@@ -1014,7 +1014,7 @@ setlinebuf SIGFE
setlocale NOSIGFE
setlogmask NOSIGFE
setmntent SIGFE
-setmode = cygwin_setmode SIGFE
+_setmode = cygwin_setmode SIGFE
setpassent NOSIGFE
setpgid SIGFE
setpgrp SIGFE
Index: syscalls.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/syscalls.cc,v
retrieving revision 1.638.2.10
diff -u -p -r1.638.2.10 syscalls.cc
--- syscalls.cc 9 Feb 2013 20:38:03 -0000 1.638.2.10
+++ syscalls.cc 22 Feb 2013 09:26:46 -0000
@@ -2891,6 +2891,8 @@ truncate (const char *pathname, _off_t l
}
#endif
+#undef get_osfhandle
+
extern "C" long
get_osfhandle (int fd)
{
Index: include/io.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/io.h,v
retrieving revision 1.3
diff -u -p -r1.3 io.h
--- include/io.h 17 Sep 2001 21:29:19 -0000 1.3
+++ include/io.h 22 Feb 2013 09:26:46 -0000
@@ -18,9 +18,10 @@ extern "C" {
/*
* Function to return a Win32 HANDLE from a fd.
*/
-extern long get_osfhandle(int);
-extern int setmode (int __fd, int __mode);
-int access(const char *__path, int __amode);
+extern long _get_osfhandle(int);
+#define get_osfhandle(i) _get_osfhandle(i);
+extern int _setmode (int __fd, int __mode);
+#define setmode(f,m) _setmode((f),(m))
#ifdef __cplusplus
};