public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] --enable-dynamic-string default for mingw-w64 v2
@ 2011-10-01  6:04 JonY
  2011-10-01  6:30 ` [Mingw-w64-developer] " Ozkan Sezer
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: JonY @ 2011-10-01  6:04 UTC (permalink / raw)
  To: Gcc Patch List, mingw-w64-developer


[-- Attachment #1.1: Type: text/plain, Size: 268 bytes --]

Hi,

I followed Paolo's suggestion with the os_defines.h trick. I duplicated
os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
built-in defines to tell the 2 apart unless you include some headers
like _mingw.h.

Patch attached, comments?

[-- Attachment #1.2: w64-dynamic.txt --]
[-- Type: text/plain, Size: 5793 bytes --]

Index: configure.host
===================================================================
--- configure.host	(revision 179411)
+++ configure.host	(working copy)
@@ -260,8 +260,15 @@
     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"
+        ;;
     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
     ;;
   netbsd*)
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 179411)
+++ 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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 179411)
+++ 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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_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 !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_GLIBCXX_FULLY_DYNAMIC_STRING == 0)
       if (_M_rep() == &_S_empty_rep())
 	return;
 #endif
Index: config/os/mingw32-w64/os_defines.h
===================================================================
--- config/os/mingw32-w64/os_defines.h	(revision 179411)
+++ config/os/mingw32-w64/os_defines.h	(working copy)
@@ -65,4 +65,9 @@
 // ioctlsocket function doesn't work for normal file-descriptors.
 #define _GLIBCXX_NO_IOCTL 1
 
+// mingw-w64 should use fully-dynamic-string by default
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#define _GLIBCXX_FULLY_DYNAMIC_STRING 1
 #endif
+
+#endif
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 179411)
+++ 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(_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])
 ])
 
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Mingw-w64-developer] [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01  6:04 [patch] --enable-dynamic-string default for mingw-w64 v2 JonY
@ 2011-10-01  6:30 ` Ozkan Sezer
  2011-10-01  9:16 ` Paolo Carlini
  2011-10-01 10:34 ` Pedro Alves
  2 siblings, 0 replies; 20+ messages in thread
From: Ozkan Sezer @ 2011-10-01  6:30 UTC (permalink / raw)
  To: mingw-w64-developer; +Cc: gcc-patches

On Sat, Oct 1, 2011 at 9:03 AM, JonY <jon_y@users.sourceforge.net> wrote:
> Hi,
>
> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
> built-in defines to tell the 2 apart unless you include some headers
> like _mingw.h.
>
> Patch attached, comments?

Why _GLIBCXX_FULLY_DYNAMIC_STRING being defined or not defined
is not enough?

--
O.S.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01  6:04 [patch] --enable-dynamic-string default for mingw-w64 v2 JonY
  2011-10-01  6:30 ` [Mingw-w64-developer] " Ozkan Sezer
@ 2011-10-01  9:16 ` Paolo Carlini
  2011-10-01  9:49   ` JonY
  2011-10-01 10:34 ` Pedro Alves
  2 siblings, 1 reply; 20+ messages in thread
From: Paolo Carlini @ 2011-10-01  9:16 UTC (permalink / raw)
  To: JonY; +Cc: Gcc Patch List, mingw-w64-developer

On 10/01/2011 08:03 AM, JonY wrote:
> Hi,
>
> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
> built-in defines to tell the 2 apart unless you include some headers
> like _mingw.h.
>
> Patch attached, comments?
These:

+#if !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) || (_GLIBCXX_FULLY_DYNAMIC_STRING == 0)


can be simplified to just:

+#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0


Ok with those changes and a proper ChangeLog entry, of course.

Thanks,
Paolo.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01  9:16 ` Paolo Carlini
@ 2011-10-01  9:49   ` JonY
  2011-10-01 10:10     ` Paolo Carlini
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-01  9:49 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: Gcc Patch List, mingw-w64-developer


[-- Attachment #1.1: Type: text/plain, Size: 716 bytes --]

On 10/1/2011 17:15, Paolo Carlini wrote:
> On 10/01/2011 08:03 AM, JonY wrote:
>> Hi,
>>
>> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
>> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
>> built-in defines to tell the 2 apart unless you include some headers
>> like _mingw.h.
>>
>> Patch attached, comments?
> These:
> 
> +#if !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) ||
> (_GLIBCXX_FULLY_DYNAMIC_STRING == 0)
> 
> 
> can be simplified to just:
> 
> +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
> 
> 
> Ok with those changes and a proper ChangeLog entry, of course.
> 

OK, removed the !defined part and included the ChangeLog, everything OK?

[-- Attachment #1.2: w64-dynamic.txt --]
[-- Type: text/plain, Size: 6249 bytes --]

Index: configure.host
===================================================================
--- configure.host	(revision 179411)
+++ configure.host	(working copy)
@@ -260,8 +260,15 @@
     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"
+        ;;
     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
     ;;
   netbsd*)
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 179411)
+++ 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 179411)
+++ 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: ChangeLog
===================================================================
--- ChangeLog	(revision 179411)
+++ ChangeLog	(working copy)
@@ -1,3 +1,16 @@
+2011-10-01  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.
+
 2011-09-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	* include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
Index: config/os/mingw32-w64/os_defines.h
===================================================================
--- config/os/mingw32-w64/os_defines.h	(revision 179411)
+++ config/os/mingw32-w64/os_defines.h	(working copy)
@@ -65,4 +65,9 @@
 // ioctlsocket function doesn't work for normal file-descriptors.
 #define _GLIBCXX_NO_IOCTL 1
 
+// mingw-w64 should use fully-dynamic-string by default
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#define _GLIBCXX_FULLY_DYNAMIC_STRING 1
 #endif
+
+#endif
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 179411)
+++ 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(_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])
 ])
 
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01  9:49   ` JonY
@ 2011-10-01 10:10     ` Paolo Carlini
  2011-10-01 11:10       ` JonY
  0 siblings, 1 reply; 20+ messages in thread
From: Paolo Carlini @ 2011-10-01 10:10 UTC (permalink / raw)
  To: JonY; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz

On 10/01/2011 11:48 AM, JonY wrote:
> On 10/1/2011 17:15, Paolo Carlini wrote:
>> On 10/01/2011 08:03 AM, JonY wrote:
>>> Hi,
>>>
>>> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
>>> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
>>> built-in defines to tell the 2 apart unless you include some headers
>>> like _mingw.h.
>>>
>>> Patch attached, comments?
>> These:
>>
>> +#if !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) ||
>> (_GLIBCXX_FULLY_DYNAMIC_STRING == 0)
>>
>>
>> can be simplified to just:
>>
>> +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
>>
>>
>> Ok with those changes and a proper ChangeLog entry, of course.
>>
> OK, removed the !defined part and included the ChangeLog, everything OK?
You should have also regenerated configure and config.h.in, right?

Otherwise, patch looks good to me, but I guess we need to hear from a 
mingw maintainer. Kai?

Paolo.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01  6:04 [patch] --enable-dynamic-string default for mingw-w64 v2 JonY
  2011-10-01  6:30 ` [Mingw-w64-developer] " Ozkan Sezer
  2011-10-01  9:16 ` Paolo Carlini
@ 2011-10-01 10:34 ` Pedro Alves
  2011-10-01 11:16   ` JonY
  2 siblings, 1 reply; 20+ messages in thread
From: Pedro Alves @ 2011-10-01 10:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: JonY, mingw-w64-developer

On Saturday 01 October 2011 07:03:35, JonY wrote:
> Hi,
> 
> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
> built-in defines to tell the 2 apart unless you include some headers
> like _mingw.h.

Are we really introducing a bunch of duplication between 
os/mingw32/ and os/mingw32-w64/ ?  I didn't see the part that adds the
new dir and does all those copies in the patch; where is it?  Or have
I missed something?  Can't we make configure add
-D__IM_REALLY_W64_YOU_KNOW to CFLAGS instead?  Or come up with a way
to point libstd++ to pick up a new mingw32/os_defines_w64.h file instead
that does:

#include "os_defines.h"
// mingw-w64 should use fully-dynamic-string by default
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
#define _GLIBCXX_FULLY_DYNAMIC_STRING 1
#endif

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 10:10     ` Paolo Carlini
@ 2011-10-01 11:10       ` JonY
  2011-10-01 11:16         ` Paolo Carlini
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-01 11:10 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

On 10/1/2011 18:08, Paolo Carlini wrote:
> On 10/01/2011 11:48 AM, JonY wrote:
>> On 10/1/2011 17:15, Paolo Carlini wrote:
>>> On 10/01/2011 08:03 AM, JonY wrote:
>>>> Hi,
>>>>
>>>> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
>>>> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
>>>> built-in defines to tell the 2 apart unless you include some headers
>>>> like _mingw.h.
>>>>
>>>> Patch attached, comments?
>>> These:
>>>
>>> +#if !defined (_GLIBCXX_FULLY_DYNAMIC_STRING) ||
>>> (_GLIBCXX_FULLY_DYNAMIC_STRING == 0)
>>>
>>>
>>> can be simplified to just:
>>>
>>> +#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
>>>
>>>
>>> Ok with those changes and a proper ChangeLog entry, of course.
>>>
>> OK, removed the !defined part and included the ChangeLog, everything OK?
> You should have also regenerated configure and config.h.in, right?
> 
> Otherwise, patch looks good to me, but I guess we need to hear from a
> mingw maintainer. Kai?
> 
> Paolo.
> 

Thanks, but I am having problems sending a proper diff with the
regenerated files, they have a lot of unrelated, even if I made sure I
am using autoconf 2.64 and automake 1.11.1.

I guess its due to libtool versions, any ideas how to fix this?



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 11:10       ` JonY
@ 2011-10-01 11:16         ` Paolo Carlini
  2011-10-01 14:32           ` JonY
  0 siblings, 1 reply; 20+ messages in thread
From: Paolo Carlini @ 2011-10-01 11:16 UTC (permalink / raw)
  To: JonY; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz

Hi,

> Thanks, but I am having problems sending a proper diff with the
> regenerated files, they have a lot of unrelated, even if I made sure I
> am using autoconf 2.64 and automake 1.11.1.

To be clear, regenerated files should **not** be part of the patch submitted for review, but should definitely appear on the ChangeLog and the changes eventually committed.

> I guess its due to libtool versions, any ideas how to fix this?

Nope, sorry, on Linux, provided the versions are correct - please double check that, I'm traveling - regen works like a charm. You just invoke autoreconf, right?

Paolo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 10:34 ` Pedro Alves
@ 2011-10-01 11:16   ` JonY
  2011-10-01 13:02     ` Pedro Alves
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-01 11:16 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gcc-patches, mingw-w64-developer

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On 10/1/2011 18:33, Pedro Alves wrote:
> On Saturday 01 October 2011 07:03:35, JonY wrote:
>> Hi,
>>
>> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
>> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
>> built-in defines to tell the 2 apart unless you include some headers
>> like _mingw.h.
> 
> Are we really introducing a bunch of duplication between 
> os/mingw32/ and os/mingw32-w64/ ?  I didn't see the part that adds the
> new dir and does all those copies in the patch; where is it?  Or have
> I missed something?  Can't we make configure add
> -D__IM_REALLY_W64_YOU_KNOW to CFLAGS instead?  Or come up with a way
> to point libstd++ to pick up a new mingw32/os_defines_w64.h file instead
> that does:
> 
> #include "os_defines.h"
> // mingw-w64 should use fully-dynamic-string by default
> #ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
> #define _GLIBCXX_FULLY_DYNAMIC_STRING 1
> #endif
> 

The new files are missing from svn diff because I used svn copy to copy
the directories, svn diff didn't show them, should I use something else
instead?

IMHO, mingw.org and mingw-w64 may or may not diverge further in the
future, so sprinkling defines to codes isn't very good in the long run.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 11:16   ` JonY
@ 2011-10-01 13:02     ` Pedro Alves
  2011-10-01 15:06       ` Kai Tietz
  0 siblings, 1 reply; 20+ messages in thread
From: Pedro Alves @ 2011-10-01 13:02 UTC (permalink / raw)
  To: JonY; +Cc: gcc-patches, mingw-w64-developer

On Saturday 01 October 2011 12:15:42, JonY wrote:
> On 10/1/2011 18:33, Pedro Alves wrote:
> > On Saturday 01 October 2011 07:03:35, JonY wrote:
> >> Hi,
> >>
> >> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
> >> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
> >> built-in defines to tell the 2 apart unless you include some headers
> >> like _mingw.h.
> > 
> > Are we really introducing a bunch of duplication between 
> > os/mingw32/ and os/mingw32-w64/ ?  I didn't see the part that adds the
> > new dir and does all those copies in the patch; where is it?  Or have
> > I missed something?  Can't we make configure add
> > -D__IM_REALLY_W64_YOU_KNOW to CFLAGS instead?  Or come up with a way
> > to point libstd++ to pick up a new mingw32/os_defines_w64.h file instead
> > that does:
> > 
> > #include "os_defines.h"
> > // mingw-w64 should use fully-dynamic-string by default
> > #ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
> > #define _GLIBCXX_FULLY_DYNAMIC_STRING 1
> > #endif
> > 
> 
> The new files are missing from svn diff because I used svn copy to copy
> the directories, svn diff didn't show them, should I use something else
> instead?

So that'd be a patch with its own ChangeLog, as your patch applies on
top of that already.

> IMHO, mingw.org and mingw-w64 may or may not diverge further in the
> future, so sprinkling defines to codes isn't very good in the long run.

"may or may not" is key.  We don't know the future, but we know
the present. We do know that code duplication is bad.  I can just
as well say,

IMHO, mingw.org and mingw-w64 may or may not diverge further in the
future (ideally they wouldn't), so adding code duplication when
we only need one define isn't very good in the long run.

But I'm not a maintainer, so I shall just go away.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 11:16         ` Paolo Carlini
@ 2011-10-01 14:32           ` JonY
  2011-10-06 12:55             ` JonY
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-01 14:32 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz


[-- Attachment #1.1: Type: text/plain, Size: 1025 bytes --]

On 10/1/2011 19:16, Paolo Carlini wrote:
> Hi,
> 
>> Thanks, but I am having problems sending a proper diff with the
>> regenerated files, they have a lot of unrelated, even if I made sure I
>> am using autoconf 2.64 and automake 1.11.1.
> 
> To be clear, regenerated files should **not** be part of the patch submitted for review, but should definitely appear on the ChangeLog and the changes eventually committed.
> 

After some careful adjustments, I see just configure and config.h.in
changed.

New patch with updated Changelog attached. Be sure to copy
config/os/mingw32 over to config/os/mingw32-w64 before continuing.

>> I guess its due to libtool versions, any ideas how to fix this?
> 
> Nope, sorry, on Linux, provided the versions are correct - please double check that, I'm traveling - regen works like a charm. You just invoke autoreconf, right?
> 
> Paolo

Yeah, just "autoreconf" under Cygwin to regenerate them, calling
autoconf and autoheader avoids new libtool getting pulled in.


[-- Attachment #1.2: w64-dynamic.txt --]
[-- Type: text/plain, Size: 6497 bytes --]

Index: configure.host
===================================================================
--- configure.host	(revision 179411)
+++ configure.host	(working copy)
@@ -260,8 +260,15 @@
     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"
+        ;;
     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
     ;;
   netbsd*)
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 179411)
+++ 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 179411)
+++ 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: ChangeLog
===================================================================
--- ChangeLog	(revision 179411)
+++ ChangeLog	(working copy)
@@ -1,3 +1,18 @@
+2011-10-01  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.
+
 2011-09-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	* include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
Index: config/os/mingw32-w64/os_defines.h
===================================================================
--- config/os/mingw32-w64/os_defines.h	(revision 179411)
+++ config/os/mingw32-w64/os_defines.h	(working copy)
@@ -65,4 +65,9 @@
 // ioctlsocket function doesn't work for normal file-descriptors.
 #define _GLIBCXX_NO_IOCTL 1
 
+// mingw-w64 should use fully-dynamic-string by default
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+#define _GLIBCXX_FULLY_DYNAMIC_STRING 1
 #endif
+
+#endif
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 179411)
+++ 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])
 ])
 
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 13:02     ` Pedro Alves
@ 2011-10-01 15:06       ` Kai Tietz
  0 siblings, 0 replies; 20+ messages in thread
From: Kai Tietz @ 2011-10-01 15:06 UTC (permalink / raw)
  To: Pedro Alves; +Cc: JonY, gcc-patches, mingw-w64-developer

2011/10/1 Pedro Alves <pedro@codesourcery.com>:
> On Saturday 01 October 2011 12:15:42, JonY wrote:
>> On 10/1/2011 18:33, Pedro Alves wrote:
>> > On Saturday 01 October 2011 07:03:35, JonY wrote:
>> >> Hi,
>> >>
>> >> I followed Paolo's suggestion with the os_defines.h trick. I duplicated
>> >> os/mingw32/ to os/mingw32-w64/ for this to work, since there aren't any
>> >> built-in defines to tell the 2 apart unless you include some headers
>> >> like _mingw.h.
>> >
>> > Are we really introducing a bunch of duplication between
>> > os/mingw32/ and os/mingw32-w64/ ?  I didn't see the part that adds the
>> > new dir and does all those copies in the patch; where is it?  Or have
>> > I missed something?  Can't we make configure add
>> > -D__IM_REALLY_W64_YOU_KNOW to CFLAGS instead?  Or come up with a way
>> > to point libstd++ to pick up a new mingw32/os_defines_w64.h file instead
>> > that does:
>> >
>> > #include "os_defines.h"
>> > // mingw-w64 should use fully-dynamic-string by default
>> > #ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
>> > #define _GLIBCXX_FULLY_DYNAMIC_STRING 1
>> > #endif
>> >
>>
>> The new files are missing from svn diff because I used svn copy to copy
>> the directories, svn diff didn't show them, should I use something else
>> instead?
>
> So that'd be a patch with its own ChangeLog, as your patch applies on
> top of that already.
>
>> IMHO, mingw.org and mingw-w64 may or may not diverge further in the
>> future, so sprinkling defines to codes isn't very good in the long run.
>
> "may or may not" is key.  We don't know the future, but we know
> the present. We do know that code duplication is bad.  I can just
> as well say,

Well, this situation isn't ideal.  It might be that one day mingw.org
and mingw-w64 venture come more near in feature-set.  But this is for
sure more a long-term issue and not a short or medium-term thing.

> IMHO, mingw.org and mingw-w64 may or may not diverge further in the
> future (ideally they wouldn't), so adding code duplication when
> we only need one define isn't very good in the long run.
>
> But I'm not a maintainer, so I shall just go away.

Well, we diverge already more and more.  I plan to provide for
libstdc++ some new printf/scanf API features for wide and ascii
variants, which is present in mingw-w64 venture, but not in mingw.org
venture.  We have also other divergencies in other feature-set, which
lead already to an add-on header in gcc for specific mingw-w64
targets.

Kai

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-01 14:32           ` JonY
@ 2011-10-06 12:55             ` JonY
  2011-10-08 15:43               ` JonY
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-06 12:55 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

On 10/1/2011 22:31, JonY wrote:
> On 10/1/2011 19:16, Paolo Carlini wrote:
>> Hi,
>>
>>> Thanks, but I am having problems sending a proper diff with the
>>> regenerated files, they have a lot of unrelated, even if I made sure I
>>> am using autoconf 2.64 and automake 1.11.1.
>>
>> To be clear, regenerated files should **not** be part of the patch submitted for review, but should definitely appear on the ChangeLog and the changes eventually committed.
>>
> 
> After some careful adjustments, I see just configure and config.h.in
> changed.
> 
> New patch with updated Changelog attached. Be sure to copy
> config/os/mingw32 over to config/os/mingw32-w64 before continuing.
> 
>>> I guess its due to libtool versions, any ideas how to fix this?
>>
>> Nope, sorry, on Linux, provided the versions are correct - please double check that, I'm traveling - regen works like a charm. You just invoke autoreconf, right?
>>
>> Paolo
> 
> Yeah, just "autoreconf" under Cygwin to regenerate them, calling
> autoconf and autoheader avoids new libtool getting pulled in.
> 

Sorry, there seems to be another problem with the patch, I'll work on it
during the weekends.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-06 12:55             ` JonY
@ 2011-10-08 15:43               ` JonY
  2011-10-08 16:11                 ` Paolo Carlini
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-08 15:43 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz


[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]

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.


[-- Attachment #1.2: w64-dynamic.txt --]
[-- Type: text/plain, Size: 6132 bytes --]

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])
 ])
 
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-08 15:43               ` JonY
@ 2011-10-08 16:11                 ` Paolo Carlini
  2011-10-08 17:54                   ` Kai Tietz
  0 siblings, 1 reply; 20+ messages in thread
From: Paolo Carlini @ 2011-10-08 16:11 UTC (permalink / raw)
  To: JonY; +Cc: Gcc Patch List, mingw-w64-developer, Kai Tietz

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
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-08 16:11                 ` Paolo Carlini
@ 2011-10-08 17:54                   ` Kai Tietz
  2011-10-13 13:47                     ` JonY
  0 siblings, 1 reply; 20+ messages in thread
From: Kai Tietz @ 2011-10-08 17:54 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: JonY, Gcc Patch List, mingw-w64-developer

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-08 17:54                   ` Kai Tietz
@ 2011-10-13 13:47                     ` JonY
  2011-10-13 13:59                       ` Paolo Carlini
  0 siblings, 1 reply; 20+ messages in thread
From: JonY @ 2011-10-13 13:47 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Paolo Carlini, Gcc Patch List, mingw-w64-developer

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

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?



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-13 13:47                     ` JonY
@ 2011-10-13 13:59                       ` Paolo Carlini
  2011-10-13 14:09                         ` NightStrike
  2011-10-13 14:33                         ` Kai Tietz
  0 siblings, 2 replies; 20+ messages in thread
From: Paolo Carlini @ 2011-10-13 13:59 UTC (permalink / raw)
  To: JonY; +Cc: Kai Tietz, Gcc Patch List, mingw-w64-developer

> 
> 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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-13 13:59                       ` Paolo Carlini
@ 2011-10-13 14:09                         ` NightStrike
  2011-10-13 14:33                         ` Kai Tietz
  1 sibling, 0 replies; 20+ messages in thread
From: NightStrike @ 2011-10-13 14:09 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: JonY, Kai Tietz, Gcc Patch List, mingw-w64-developer

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?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [patch] --enable-dynamic-string default for mingw-w64 v2
  2011-10-13 13:59                       ` Paolo Carlini
  2011-10-13 14:09                         ` NightStrike
@ 2011-10-13 14:33                         ` Kai Tietz
  1 sibling, 0 replies; 20+ messages in thread
From: Kai Tietz @ 2011-10-13 14:33 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: JonY, Gcc Patch List, mingw-w64-developer

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-10-13 13:59 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-01  6:04 [patch] --enable-dynamic-string default for mingw-w64 v2 JonY
2011-10-01  6:30 ` [Mingw-w64-developer] " Ozkan Sezer
2011-10-01  9:16 ` Paolo Carlini
2011-10-01  9:49   ` JonY
2011-10-01 10:10     ` Paolo Carlini
2011-10-01 11:10       ` JonY
2011-10-01 11:16         ` Paolo Carlini
2011-10-01 14:32           ` JonY
2011-10-06 12:55             ` JonY
2011-10-08 15:43               ` JonY
2011-10-08 16:11                 ` Paolo Carlini
2011-10-08 17:54                   ` Kai Tietz
2011-10-13 13:47                     ` JonY
2011-10-13 13:59                       ` Paolo Carlini
2011-10-13 14:09                         ` NightStrike
2011-10-13 14:33                         ` Kai Tietz
2011-10-01 10:34 ` Pedro Alves
2011-10-01 11:16   ` JonY
2011-10-01 13:02     ` Pedro Alves
2011-10-01 15:06       ` Kai Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).