Force usage of assert() condition when NDEBUG is defined
[lttng-tools.git] / src / common / compat / dirent.h
1 /*
2 * Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #ifndef _COMPAT_DIRENT_H
9 #define _COMPAT_DIRENT_H
10
11 #include <dirent.h>
12
13 #ifdef HAVE_DIRFD
14 static inline
15 int lttng_dirfd(DIR *dir) {
16 return dirfd(dir);
17 }
18 #else
19 # ifndef __XOPEN_OR_POSIX
20 static inline
21 int lttng_dirfd(DIR *dir) {
22 return dir->dd_fd;
23 }
24 # else
25 static inline
26 int lttng_dirfd(DIR *dir) {
27 return dir->d_fd;
28 }
29 # endif
30 #endif
31
32 #endif /* _COMPAT_DIRENT_H */
This page took 0.031054 seconds and 4 git commands to generate.