[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH] Compile guard restrict keyword in readdir_r from c++ builds



The restrict keyword only applies to gcc, use compile guards so that
the keyword does not break c++ builds.

Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
---
 include/dirent.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/dirent.h b/include/dirent.h
index 8532930..4064f39 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -66,8 +66,16 @@ int closedir(DIR *dirp);
 DIR *fdopendir(int fd);
 DIR *opendir(const char *name);
 struct dirent *readdir(DIR *dirp);
+
+/* restrict keyword is ony supported by C99 standard, not c++ */
+#ifdef __cplusplus
+int readdir_r(DIR *dirp, struct dirent *entry,
+               struct dirent ** result);
+#else
 int readdir_r(DIR *restrict dirp, struct dirent *restrict entry,
-               struct dirent **restrict result);
+                struct dirent **restrict result);
+#endif
+
 void rewinddir(DIR *dirp);
 int dirfd(DIR *dirp);
 
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.