Hello,

this patch adds some errno values supported by newer runtime-version.
To keep backward compatibility
this patch checks for their definition before trying to use them.
Especially the EPERM error-number is required for having ISO-C++0x
std::thread support enabled with
winpthread libary for 32-bit and 64-bit Windows host.

ChangeLog

2011-08-28  Kai Tietz  <kti...@redhat.com>

        * config/os/mingw32/error_constants.h (ECHILD): Add support,
        if present.
        (ENOSPC): Likewise.
        (EPERM): Likewise.

Bootstrapped and regression tested for x86_64-w64-mingw32 and
i686-w64-mingw32.  Ok for apply?

Regards,
Kai

Index: error_constants.h
===================================================================
--- error_constants.h   (revision 178096)
+++ error_constants.h   (working copy)
@@ -79,13 +79,17 @@
 //    network_reset =                          ENETRESET,
 //    network_unreachable =                    ENETUNREACH,
 //    no_buffer_space =                        ENOBUFS,
-//    no_child_process =                       ECHILD,
+#ifdef ECHILD
+      no_child_process =                       ECHILD,
+#endif
 //    no_link =                                ENOLINK,
       no_lock_available =                      ENOLCK,
 //    no_message_available =                   ENODATA,
 //    no_message =                             ENOMSG,
 //    no_protocol_option =                     ENOPROTOOPT,
-//    no_space_on_device =                     ENOSPC,
+#ifdef ENOSPC
+      no_space_on_device =                     ENOSPC,
+#endif
 //    no_stream_resources =                    ENOSR,
       no_such_device_or_address =              ENXIO,
       no_such_device =                                 ENODEV,
@@ -99,7 +103,9 @@
 //    not_supported =                          ENOTSUP,
 //    operation_canceled =                     ECANCELED,
 //    operation_in_progress =                  EINPROGRESS,
-//    operation_not_permitted =                EPERM,
+#ifdef EPERM
+      operation_not_permitted =                EPERM,
+#endif
 //    operation_not_supported =                EOPNOTSUPP,
 //    operation_would_block =                  EWOULDBLOCK,
 //    owner_dead =                             EOWNERDEAD,

Reply via email to