Backed out 2 changesets (bug 903746) for causing non-unified build bustages on nsIPri...
[gecko.git] / third_party / jpeg-xl / third_party / dirent.h
blob37a08f425be9260bce8f3c463a6f223629bd9de8
1 // Copyright (c) the JPEG XL Project
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
24 #ifndef _MODE_T_
25 typedef unsigned int mode_t;
26 #endif // _MODE_T_
27 int mkdir(const char* path, mode_t mode);
29 struct dirent {
30 char* d_name; // no path
33 #define stat _stat64
35 #ifndef S_ISDIR
36 #define S_ISDIR(m) (m & S_IFDIR)
37 #endif // S_ISDIR
39 #ifndef S_ISREG
40 #define S_ISREG(m) (m & S_IFREG)
41 #endif // S_ISREG
43 struct DIR;
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_