This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] __cdecl changes for Cygwin


All of the functions that cygwin exports use (unfortunately) the Microsoft
__cdecl attribute.  However, this is not explicitly set in any of the newlib
header files.  This patch fixes that.

This is pretty Cygwin specific except for the addition of the new _EXFUNVAR
macro.

cgf

Wed Sep  6 13:49:51 2000  Christopher Faylor <cgf@cygnus.com>

	* libc/include/_ansi.h (_EXFUN): Define specially for __CYGWIN__.
	(_EXFUNVAR): New macro for defining a variable pointing to a function.
	* libc/include/stdlib.h: Use _EXFUNVAR.
Index: libc/include/_ansi.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/_ansi.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 _ansi.h
--- _ansi.h	2000/02/17 19:39:46	1.1.1.1
+++ _ansi.h	2000/09/06 17:53:49
@@ -31,7 +31,13 @@
 #define	_SIGNED		signed
 #define	_DOTS		, ...
 #define _VOID void
+#ifdef __CYGWIN__
+#define	_EXFUN(name, proto)		__cdecl name proto
+#define _EXFUNVAR(name, proto)		(* __cdecl name) proto
+#else
 #define	_EXFUN(name, proto)		name proto
+#define _EXFUNVAR(name, proto)		(* name) proto
+#endif
 #define	_DEFUN(name, arglist, args)	name(args)
 #define	_DEFUN_VOID(name)		name(_NOARGS)
 #define _CAST_VOID (void)
Index: libc/include/stdlib.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdlib.h,v
retrieving revision 1.4
diff -u -p -r1.4 stdlib.h
--- stdlib.h	2000/08/01 20:51:51	1.4
+++ stdlib.h	2000/09/06 17:53:49
@@ -56,7 +56,7 @@ _PTR	_EXFUN(bsearch,(const _PTR __key,
 		       const _PTR __base,
 		       size_t __nmemb,
 		       size_t __size,
-		       int _EXFUN((*_compar),(const _PTR, const _PTR))));
+		       int _EXFUNVAR(_compar,(const _PTR, const _PTR))));
 _PTR	_EXFUN(calloc,(size_t __nmemb, size_t __size));
 div_t	_EXFUN(div,(int __numer, int __denom));
 _VOID	_EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]