1 // Copyright (c) the JPEG XL Project
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef LIB_JXL_THIRD_PARTY_DIRENT_H_
16 #define LIB_JXL_THIRD_PARTY_DIRENT_H_
18 // Emulates POSIX readdir for Windows
20 #if defined(_WIN32) || defined(_WIN64)
22 #include <sys/stat.h> // S_IFREG
25 typedef unsigned int mode_t
;
27 int mkdir(const char* path
, mode_t mode
);
30 char* d_name
; // no path
36 #define S_ISDIR(m) (m & S_IFDIR)
40 #define S_ISREG(m) (m & S_IFREG)
44 DIR* opendir(const char* path
);
45 int closedir(DIR* dir
);
46 dirent
* readdir(DIR* d
);
48 #endif // #if defined(_WIN32) || defined(_WIN64)
49 #endif // LIB_JXL_THIRD_PARTY_DIRENT_H_