Skip to content
Browse files

Fix mbstate_t for GLIBC 2.16

GLIBC < 2.16 requires __mbstate_t_defined while GLIBC 2.16 requires
____mbstate_t_defined. Also setting the former in 2.16 leads to failures,
e.g. for "#include <iostream>. The change was required due to the GLIBC patch
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=db6af3ebf46a83b885455dc03a3c2c1c2c2dedec

* include/rw/_mbstate.h (mbstate_t): Include features and use __GLIBC__
  and __GLIBC_MINOR__ for defingin ____mbstate_t_defined vs. __mbstate_t_defined.
  • Loading branch information...
1 parent 399cb60 commit 18dd5d7b9f7b9f26f837fa4ec0f9245d9f33d26d @tob2 tob2 committed Dec 27, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 include/rw/_mbstate.h
View
9 include/rw/_mbstate.h
@@ -131,10 +131,15 @@ _USING (::mbstate_t);
# if defined (_RWSTD_OS_LINUX)
/*** Linux/glibc **********************************************************/
+# include <features.h> /* For __GLIBC__ and __GLIBC_MINOR__ */
+
// define __mbstate_t at file scope (see /usr/include/wchar.h)
# if !defined (__mbstate_t_defined) && !defined (____mbstate_t_defined)
-# define __mbstate_t_defined 1
-# define ____mbstate_t_defined 1
+# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 16
+# define ____mbstate_t_defined 1
+# else
+# define __mbstate_t_defined 1
+# endif
extern "C" {

0 comments on commit 18dd5d7

Please sign in to comment.
Something went wrong with that request. Please try again.