about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-08 16:03:24 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-08 16:07:57 +0200
commite3ae80adbc626c4073a082e0205fdbb83033018a (patch)
tree92de469f1d5dc736809bf3f1beafa673205ba04b /sysdeps/mach
parent3fcfb76bab97e55e7491db5fc1f11655b0993865 (diff)
downloadglibc-e3ae80adbc626c4073a082e0205fdbb83033018a.tar.gz
glibc-e3ae80adbc626c4073a082e0205fdbb83033018a.tar.xz
glibc-e3ae80adbc626c4073a082e0205fdbb83033018a.zip
hurd: Make error_t an int in C++
Making error_t defined to enum __error_t_codes conveniently makes the
debugger print symbolic values, but in C++ int is not interoperable with
enum __error_t_codes, leading to C++ application build issues, so let's
revert error_t to int in C++.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/bits/types/error_t.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/bits/types/error_t.h b/sysdeps/mach/hurd/bits/types/error_t.h
index 380aa434d5..4a7bd452c8 100644
--- a/sysdeps/mach/hurd/bits/types/error_t.h
+++ b/sysdeps/mach/hurd/bits/types/error_t.h
@@ -24,6 +24,12 @@
 #ifndef __error_t_defined
 # define __error_t_defined 1
 
+#ifdef __cplusplus
+/* Unfortunately, in C++ int and enum __error_t_codes are not
+   interoperable...  */
+typedef int error_t;
+#else
 typedef enum __error_t_codes error_t;
+#endif
 
 #endif