Skip to content

Commit 5dcccba

Browse files
besentvmadewokherd
authored andcommitted
support: Supress deprecation warning for readdir_r.
1 parent 800f76b commit 5dcccba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

support/dirent.c

+14
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,22 @@ Mono_Posix_Syscall_readdir_r (void *dirp, struct Mono_Posix_Syscall__Dirent *ent
9696
struct dirent *_entry = malloc (sizeof (struct dirent) + MPH_PATH_MAX + 1);
9797
int r;
9898

99+
#if defined (__clang__)
100+
#pragma clang diagnostic push
101+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
102+
#elif defined (__GNUC__)
103+
#pragma GCC diagnostic push
104+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
105+
#endif
106+
99107
r = readdir_r (dirp, _entry, (struct dirent**) result);
100108

109+
#if defined (__clang__)
110+
#pragma clang diagnostic pop
111+
#elif defined (__GNUC__)
112+
#pragma GCC diagnostic pop
113+
#endif
114+
101115
if (r == 0 && *result != NULL) {
102116
copy_dirent (entry, _entry);
103117
}

0 commit comments

Comments
 (0)