Patchwork --enable-dynamic-string default for mingw-w64 v2

login
register
mail settings
Submitter JonY
Date Oct. 8, 2011, 1:52 p.m.
Message ID <4E905599.70408@users.sourceforge.net>
Download mbox | patch
Permalink /patch/118535/
State New
Headers show

Comments

JonY - Oct. 8, 2011, 1:52 p.m.
Ok, fixed it, I made a very dumb mistake in configure.host, new patch
attached.

Changelog:
2011-10-08  Jonathan Yong  <jon_y@users.sourceforge.net>

	* configure.host: Use config/os/mingw32-w64 instead of
	config/os/mingw32 if vendor key is "w64".
	* config/os/mingw32-w64: Duplicate from config/os/mingw32.
	* config/os/mingw32-w64/os_defines.h: Enable
	_GLIBCXX_FULLY_DYNAMIC_STRING if undefined.
	* acinclude.m4: Set fully-dynamic-string to 1 when enabled,
	0 when disabled or undefined if unset by user.
	* include/bits/basic_string.h: Check if
	_GLIBCXX_FULLY_DYNAMIC_STRING is set to 0 instead of undefined.
	include/bits/basic_string.tcc: Likewise.
	* configure: Regenerated.
	* config.h.in: Likewise.
Paolo Carlini - Oct. 8, 2011, 3:44 p.m.
Hi,

> Ok, fixed it, I made a very dumb mistake in configure.host, new patch
> attached.

Patch is still ok with me, if Kai is ok with it (remember for next time: regenerated files are not posted, are just a distraction)

Paolo
>
Kai Tietz - Oct. 8, 2011, 3:50 p.m.
2011/10/8 Paolo Carlini <pcarlini@gmail.com>:
> Hi,
>
>> Ok, fixed it, I made a very dumb mistake in configure.host, new patch
>> attached.
>
> Patch is still ok with me, if Kai is ok with it (remember for next time: regenerated files are not posted, are just a distraction)
>
> Paolo

Ok, by me, too.

Thanks,
Kai
JonY - Oct. 13, 2011, 1:19 p.m.
On 10/8/2011 23:50, Kai Tietz wrote:
> 2011/10/8 Paolo Carlini:
>> Hi,
>>
>>> Ok, fixed it, I made a very dumb mistake in configure.host, new patch
>>> attached.
>>
>> Patch is still ok with me, if Kai is ok with it (remember for next time: regenerated files are not posted, are just a distraction)
>>
>> Paolo
> 
> Ok, by me, too.
> 

Ping, did this go in trunk already?
Paolo Carlini - Oct. 13, 2011, 1:47 p.m.
> 
> Ping, did this go in trunk already?

I would be surprised to see this happening if nobody like you or Kai actually does the commit ;)

P
NightStrike - Oct. 13, 2011, 1:48 p.m.
On Thu, Oct 13, 2011 at 9:47 AM, Paolo Carlini <pcarlini@gmail.com> wrote:
>>
>> Ping, did this go in trunk already?
>
> I would be surprised to see this happening if nobody like you or Kai actually does the commit ;)
>
> P
>

Does Jon have commit access?
Kai Tietz - Oct. 13, 2011, 1:59 p.m.
2011/10/13 Paolo Carlini <pcarlini@gmail.com>:
>>
>> Ping, did this go in trunk already?
>
> I would be surprised to see this happening if nobody like you or Kai actually does the commit ;)
>
> P

I will take care to apply it.

Kai

Patch

Index: configure
===================================================================
--- configure	(revision 179710)
+++ configure	(working copy)
@@ -17240,10 +17240,15 @@ 
 
 
   if test $enable_fully_dynamic_string = yes; then
+    enable_fully_dynamic_string_def=1
+  else
+    enable_fully_dynamic_string_def=0
+  fi
 
-$as_echo "#define _GLIBCXX_FULLY_DYNAMIC_STRING 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define _GLIBCXX_FULLY_DYNAMIC_STRING ${enable_fully_dynamic_string_def}
+_ACEOF
 
-  fi
 
 
 
Index: configure.host
===================================================================
--- configure.host	(revision 179710)
+++ configure.host	(working copy)
@@ -260,8 +260,16 @@ 
     atomic_word_dir=os/irix
     ;;
   mingw32*)
-    os_include_dir="os/mingw32"
-    error_constants_dir="os/mingw32"
+    case "$host" in
+      *-w64-*)
+        os_include_dir="os/mingw32-w64"
+        error_constants_dir="os/mingw32-w64"
+        ;;
+      *)
+        os_include_dir="os/mingw32"
+        error_constants_dir="os/mingw32"
+        ;;
+    esac
     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
     ;;
   netbsd*)
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 179710)
+++ include/bits/basic_string.h	(working copy)
@@ -201,7 +201,7 @@ 
 	void
 	_M_set_length_and_sharable(size_type __n)
 	{
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	  if (__builtin_expect(this != &_S_empty_rep(), false))
 #endif
 	    {
@@ -231,7 +231,7 @@ 
 	void
 	_M_dispose(const _Alloc& __a)
 	{
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	  if (__builtin_expect(this != &_S_empty_rep(), false))
 #endif
 	    {
@@ -252,7 +252,7 @@ 
 	_CharT*
 	_M_refcopy() throw()
 	{
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	  if (__builtin_expect(this != &_S_empty_rep(), false))
 #endif
             __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
@@ -430,7 +430,7 @@ 
        *  @brief  Default constructor creates an empty string.
        */
       basic_string()
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
       : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
 #else
       : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()){ }
@@ -502,7 +502,7 @@ 
       basic_string(basic_string&& __str) noexcept
       : _M_dataplus(__str._M_dataplus)
       {
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING	
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	__str._M_data(_S_empty_rep()._M_refdata());
 #else
 	__str._M_data(_S_construct(size_type(), _CharT(), get_allocator()));
Index: include/bits/basic_string.tcc
===================================================================
--- include/bits/basic_string.tcc	(revision 179710)
+++ include/bits/basic_string.tcc	(working copy)
@@ -80,7 +80,7 @@ 
       _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
 		   input_iterator_tag)
       {
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	if (__beg == __end && __a == _Alloc())
 	  return _S_empty_rep()._M_refdata();
 #endif
@@ -126,7 +126,7 @@ 
       _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
 		   forward_iterator_tag)
       {
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
 	if (__beg == __end && __a == _Alloc())
 	  return _S_empty_rep()._M_refdata();
 #endif
@@ -154,7 +154,7 @@ 
     basic_string<_CharT, _Traits, _Alloc>::
     _S_construct(size_type __n, _CharT __c, const _Alloc& __a)
     {
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
       if (__n == 0 && __a == _Alloc())
 	return _S_empty_rep()._M_refdata();
 #endif
@@ -456,7 +456,7 @@ 
     basic_string<_CharT, _Traits, _Alloc>::
     _M_leak_hard()
     {
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
       if (_M_rep() == &_S_empty_rep())
 	return;
 #endif
Index: config.h.in
===================================================================
--- config.h.in	(revision 179710)
+++ config.h.in	(working copy)
@@ -707,7 +707,8 @@ 
 /* Define to use concept checking code from the boost libraries. */
 #undef _GLIBCXX_CONCEPT_CHECKS
 
-/* Define if a fully dynamic basic_string is wanted. */
+/* Define to 1 if a fully dynamic basic_string is wanted, 0 to disable,
+   undefined for platform defaults */
 #undef _GLIBCXX_FULLY_DYNAMIC_STRING
 
 /* Define if gthreads library is available. */
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 179710)
+++ acinclude.m4	(working copy)
@@ -564,17 +564,21 @@ 
 dnl memory (mostly useful together with shared memory allocators, see PR
 dnl libstdc++/16612 for details).
 dnl
-dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING
-dnl --disable-fully-dynamic-string leaves _GLIBCXX_FULLY_DYNAMIC_STRING undefined
+dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 1
+dnl --disable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING to 0
+dnl otherwise undefined
 dnl  +  Usage:  GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING], [
   GLIBCXX_ENABLE(fully-dynamic-string,$1,,[do not put empty strings in per-process static memory])
   if test $enable_fully_dynamic_string = yes; then
-    AC_DEFINE(_GLIBCXX_FULLY_DYNAMIC_STRING, 1,
-	      [Define if a fully dynamic basic_string is wanted.])
+    enable_fully_dynamic_string_def=1
+  else
+    enable_fully_dynamic_string_def=0
   fi
+  AC_DEFINE_UNQUOTED([_GLIBCXX_FULLY_DYNAMIC_STRING], [${enable_fully_dynamic_string_def}],
+	      [Define to 1 if a fully dynamic basic_string is wanted, 0 to disable, undefined for platform defaults])
 ])