changeset 2110:f18c80177dfe

[xemacs-hg @ 2004-06-03 10:10:45 by didierv] EXTERN_C fixes
author didierv
date Thu, 03 Jun 2004 10:10:46 +0000
parents 92b1c3ca4824
children 317b928e9d28
files src/ChangeLog src/config.h.in src/extw-Xt.c src/nas.c
diffstat 4 files changed, 25 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jun 02 21:50:49 2004 +0000
+++ b/src/ChangeLog	Thu Jun 03 10:10:46 2004 +0000
@@ -1,3 +1,10 @@
+2004-06-03  Didier Verna  <didier@xemacs.org>
+
+	* config.h.in (EXTERN_C_BLOCK_BEGIN): New macro.
+	(EXTERN_C_BLOCK_END): Ditto.
+	* nas.c: Use them around audio headers.
+	* extw-Xt.c: Fix EXTERN_C usage (see 2004-06-02 below).
+
 2004-06-02  Didier Verna  <didier@xemacs.org>
 
 	C++ related fixes.
--- a/src/config.h.in	Wed Jun 02 21:50:49 2004 +0000
+++ b/src/config.h.in	Thu Jun 03 10:10:46 2004 +0000
@@ -957,8 +957,12 @@
 #  define catch c_catch
 
 #  define EXTERN_C extern "C"
+#  define EXTERN_C_BLOCK_BEGIN extern "C" {
+#  define EXTERN_C_BLOCK_END }
 # else /* C code */
 #  define EXTERN_C extern
+#  define EXTERN_C_BLOCK_BEGIN
+#  define EXTERN_C_BLOCK_END
 # endif
 #endif /* C or C++ */
 
--- a/src/extw-Xt.c	Wed Jun 02 21:50:49 2004 +0000
+++ b/src/extw-Xt.c	Thu Jun 03 10:10:46 2004 +0000
@@ -28,10 +28,7 @@
 ERROR!  This ought not be getting compiled if EXTERNAL_WIDGET is undefined
 #endif
 
-EXTERN_C
-{
-void fatal (const char *fmt, ...);
-}
+EXTERN_C void fatal (const char *fmt, ...);
 #else /* not emacs */
 static void fatal (char *msg);
 #endif
@@ -48,16 +45,14 @@
    for real? */
 
 #if (XT_REVISION > 5)
-EXTERN_C
-{
-  int _XtWaitForSomething (XtAppContext app, _XtBoolean ignoreEvents,
-			   _XtBoolean ignoreTimers, _XtBoolean ignoreInputs,
-			   _XtBoolean ignoreSignals, _XtBoolean block,
+EXTERN_C int
+_XtWaitForSomething (XtAppContext app, _XtBoolean ignoreEvents,
+		     _XtBoolean ignoreTimers, _XtBoolean ignoreInputs,
+		     _XtBoolean ignoreSignals, _XtBoolean block,
 #ifdef XTHREADS
-			   _XtBoolean drop_lock,
+		     _XtBoolean drop_lock,
 #endif
-			   unsigned long *howlong);
-}
+		     unsigned long *howlong);
 
 # ifndef XTHREADS
 #  define _XT_WAIT_FOR_SOMETHING(timers,inputs,events,block,howlong,appCtx) \
@@ -67,12 +62,10 @@
           _XtWaitForSomething (appCtx,events,timers,inputs,0,block,1,howlong)
 # endif
 #else
-EXTERN_C
-{
-  int _XtwaitForSomething (Boolean ignoreTimers, Boolean ignoreInputs,
-			   Boolean ignoreEvents, Boolean block,
-			   unsigned long *howlong, XtAppContext app);
-}
+EXTERN_C int
+_XtwaitForSomething (Boolean ignoreTimers, Boolean ignoreInputs,
+		     Boolean ignoreEvents, Boolean block,
+		     unsigned long *howlong, XtAppContext app);
 #endif
 
 #ifdef DEBUG_WIDGET
--- a/src/nas.c	Wed Jun 02 21:50:49 2004 +0000
+++ b/src/nas.c	Thu Jun 03 10:10:46 2004 +0000
@@ -80,14 +80,14 @@
 #undef LITTLE_ENDIAN
 #undef BIG_ENDIAN
 
-EXTERN_C
-{
+EXTERN_C_BLOCK_BEGIN
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 #include <audio/snd.h>
 #include <audio/wave.h>
 #include <audio/fileutil.h>
-}
+EXTERN_C_BLOCK_END
+
 
 /* NAS <= 1.2p5 <audio/fileutil.h> doesn't define the NAS_ versions */
 #ifndef NAS_LITTLE_ENDIAN