Use kAudioObjectPropertyElementMaster on macOS for compatibility
[openal-soft.git] / fmt-11.0.2 / test / posix-mock.h
blob545808717d50bbc6f1649232851dc58d1522f6b1
1 // Formatting library for C++ - mocks of POSIX functions
2 //
3 // Copyright (c) 2012 - present, Victor Zverovich
4 // All rights reserved.
5 //
6 // For the license information refer to format.h.
8 #ifndef FMT_POSIX_TEST_H
9 #define FMT_POSIX_TEST_H
11 #include <errno.h>
12 #include <locale.h>
13 #include <stdio.h>
14 #ifdef __APPLE__
15 # include <xlocale.h>
16 #endif
18 #ifdef _WIN32
19 # include <windows.h>
20 #else
21 # include <sys/param.h> // for FreeBSD version
22 # include <sys/types.h> // for ssize_t
23 #endif
25 #ifndef _MSC_VER
26 struct stat;
27 #endif
29 namespace test {
31 #ifndef _MSC_VER
32 // Size type for read and write.
33 using size_t = size_t;
34 using ssize_t = ssize_t;
35 int open(const char* path, int oflag, int mode);
36 int fstat(int fd, struct stat* buf);
37 #else
38 using size_t = unsigned;
39 using ssize_t = int;
40 #endif
42 #ifndef _WIN32
43 long sysconf(int name);
44 #else
45 DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
46 #endif
48 int close(int fildes);
50 int dup(int fildes);
51 int dup2(int fildes, int fildes2);
53 FILE* fdopen(int fildes, const char* mode);
55 ssize_t read(int fildes, void* buf, size_t nbyte);
56 ssize_t write(int fildes, const void* buf, size_t nbyte);
58 #ifndef _WIN32
59 int pipe(int fildes[2]);
60 #else
61 int pipe(int* pfds, unsigned psize, int textmode);
62 #endif
64 FILE* fopen(const char* filename, const char* mode);
65 int fclose(FILE* stream);
66 int(fileno)(FILE* stream);
68 #if defined(FMT_LOCALE) && !defined(_WIN32)
69 locale_t newlocale(int category_mask, const char* locale, locale_t base);
70 #endif
71 } // namespace test
73 #define FMT_SYSTEM(call) test::call
75 #endif // FMT_POSIX_TEST_H