make regoff_t and regex_t match C++ ABI
[musl] / include / regex.h
index 3673bfa..dce2177 100644 (file)
@@ -5,15 +5,18 @@
 extern "C" {
 #endif
 
+#include <features.h>
+
+#define __NEED_regoff_t
 #define __NEED_size_t
 
 #include <bits/alltypes.h>
 
-typedef long regoff_t;
-
-typedef struct {
+typedef struct re_pattern_buffer {
        size_t re_nsub;
-       void *__opaque;
+       void *__opaque, *__padding[4];
+       size_t __nsub2;
+       char __padding2;
 } regex_t;
 
 typedef struct {
@@ -46,11 +49,11 @@ typedef struct {
 
 #define REG_ENOSYS      -1
 
-int regcomp(regex_t *, const char *, int);
-int regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
+int regcomp(regex_t *__restrict, const char *__restrict, int);
+int regexec(const regex_t *__restrict, const char *__restrict, size_t, regmatch_t *__restrict, int);
 void regfree(regex_t *);
 
-size_t regerror(int, const regex_t *, char *, size_t);
+size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t);
 
 #ifdef __cplusplus
 }