expat/lib internal.h,1.5,1.6

"Fred L. Drake" <[email protected]>
Newsgroups gmane.text.xml.expat.cvs
Message-ID <[email protected]>
Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv23965

Modified Files:
	internal.h 
Log Message:
Be more defensive: only enable the *CALL macros when using GCC on
Linux, since we know the current definitions work there and have a
positive effect.
This closes SF bug #692878.


Index: internal.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/internal.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- internal.h	12 Mar 2003 23:02:11 -0000	1.5
+++ internal.h	14 Mar 2003 17:25:12 -0000	1.6
@@ -20,19 +20,20 @@
          and therefore subject to change.
 */
 
-#if defined(__GNUC__) && !defined(sun)
-/* regparm() generates warnings on Solaris boxes.   See SF bug #692878.
+#if defined(__GNUC__) && defined(linux)
+/* We'll use this version by default only where we know it helps.
+
+   regparm() generates warnings on Solaris boxes.   See SF bug #692878.
 
    Instability reported with egcs on a RedHat Linux 7.3.
-   Let's comment it out:
+   Let's comment out:
    #define FASTCALL __attribute__((stdcall, regparm(3)))
    and let's try this:
 */
 #define FASTCALL __attribute__((regparm(3)))
-#define PTRCALL
 #define PTRFASTCALL __attribute__((regparm(3)))
+#endif
 
-#elif defined(WIN32)
 /* Using __fastcall seems to have an unexpected negative effect under
    MS VC++, especially for function pointers, so we won't use it for
    now on that platform. It may be reconsidered for a future release
@@ -40,11 +41,8 @@
    Likely reason: __fastcall on Windows is like stdcall, therefore
    the compiler cannot perform stack optimizations for call clusters.
 */
-#define FASTCALL
-#define PTRCALL
-#define PTRFASTCALL
 
-#endif
+/* Make sure all of these are defined if they aren't already. */
 
 #ifndef FASTCALL
 #define FASTCALL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.