octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #38746] Including mex.h does not work with G++


From: Clemens Buchacher
Subject: [Octave-bug-tracker] [bug #38746] Including mex.h does not work with G++ 4.8
Date: Sat, 04 May 2013 16:32:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31

Follow-up Comment #1, bug #38746 (project octave):

The patch below fixes the issue for me. Instead of disallowing mexproto.h to
be included from extern "C" context, I think it is more appropriate instead
not to include C++ header files such as cstdlib in a header file which
declares only C functions. I am not sure what the motivation was for doing so,
but for the record, there are two more files with similar constructs of the
form #ifdef __cpluslus #include <cheader> extern "C" { #else <header.h>
#include #endif:

 libinterp/interp-core/cutils.h
 liboctave/cruft/misc/quit.h

I did not touch those to keep the change minimal.

---
diff -r a1f613e5066d libinterp/interp-core/mexproto.h
--- a/libinterp/interp-core/mexproto.h  Sat May 04 09:37:28 2013 +0200
+++ b/libinterp/interp-core/mexproto.h  Sat May 04 16:37:00 2013 +0200
@@ -49,11 +49,10 @@
 #define MEXPROTO_H
 
 #if defined (__cplusplus)
-#include <cstdlib>
 extern "C" {
-#else
+#endif
+
 #include <stdlib.h>
-#endif
 
 /* The definition of OCTINTERP_API is normally provided by Octave's
    config.h file.  This is provided for the case of mex.h included by

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38746>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]