C++ and std::

View: New views
1 Messages — Rating Filter:   Alert me  

C++ and std::

by Marc Glisse-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I know I pushed in favor of doing things cleanly for the C++ std
namespace. I was _a bit_ idealistic... I decided to give up on that. This
is not what gmp is about, and I can always maintain my own patch if it
itches too much. I now believe the best way to avoid trouble is, as has
been claimed by other people, something like the attached patch for
gmp-h.in. I don't necessarily expect the patch to be applied, I just
wanted to cancel what I said in the opposite direction on this mailing
list.

By the way, it seems natural to include stdarg.h by default in C++ for the
same reasons that stdio.h is included.

--
Marc Glisse
--- gmp-h.in.orig 2009-02-22 00:45:44.264364913 +0100
+++ gmp-h.in 2009-02-22 00:51:21.688543331 +0100
@@ -22,7 +22,8 @@
 
 #if defined (__cplusplus)
 #include <iosfwd>   /* for std::istream, std::ostream, std::string */
-#include <cstdio>
+#include <stdio.h>
+#include <stdarg.h>
 #endif
 
 
@@ -46,13 +47,7 @@
 #ifndef __GNU_MP__
 #define __GNU_MP__ 4
 
-#define __need_size_t  /* tell gcc stddef.h we only want size_t */
-#if defined (__cplusplus)
-#include <cstddef>     /* for size_t */
-#else
 #include <stddef.h>    /* for size_t */
-#endif
-#undef __need_size_t
 
 /* Instantiated by configure. */
 #if ! defined (__GMP_WITHIN_CONFIGURE)
@@ -517,7 +512,6 @@
 
 #if defined (__cplusplus)
 extern "C" {
-using std::FILE;
 #endif
 
 #define mp_set_memory_functions __gmp_set_memory_functions

_______________________________________________
gmp-bugs mailing list
gmp-bugs@...
http://gmplib.org/mailman/listinfo/gmp-bugs