28 #ifndef YCL_INC_NativeAPI_h_
29 #define YCL_INC_NativeAPI_h_ 1
33 #include YFM_YCLib_Platform
36 #include YFM_YBaseMacro
39 # error "Unknown platform found."
42 #define YCL_YCOMMON_H <ycommon.h>
43 #define YSL_YSBUILD_H <ysbuild.h>
61 namespace platform_replace
65 #ifdef YCL_API_USE_UNISTD
69 #ifdef YCL_API_USE_SYS_DIR
99 DMAFillWordsAsync(
u8 chan,
u32 val,
void* p_dst,
u32 size)
101 DMA_FILL(chan) =
vu32(val);
102 DMA_SRC(3) =
u32(&DMA_FILL(3));
103 DMA_DEST(3) =
u32(p_dst);
105 DMA_CR(3) = DMA_SRC_FIX | DMA_COPY_WORDS | size >> 2;
118 # define WINVER 0x0501
122 #ifndef WIN32_LEAN_AND_MEAN
123 # define WIN32_LEAN_AND_MEAN 1
129 #include <sys/stat.h>
169 #define S_IFIFO _S_IFIFO
171 #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
175 #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
181 namespace platform_replace
190 makedir(
char const* dir, ::mode_t)
192 return ::_mkdir(dir);
207 #define mkdir platform_replace::makedir
210 # if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
211 YF_API struct ::tm* __cdecl __MINGW_NOTHROW
213 _gmtime32(const ::__time32_t*);
219 namespace platform_ex
226 inline PDefH(
bool, IsDirectory, const ::WIN32_FIND_DATAA& d)
ynothrow
227 ImplRet(d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
232 inline PDefH(
bool, IsDirectory, const ::WIN32_FIND_DATAW& d)
ynothrow
233 ImplRet(d.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。