diff --git a/source/md.c b/source/md.c index 0654411..4fc63b7 100644 --- a/source/md.c +++ b/source/md.c @@ -276,7 +276,7 @@ MD_WIN32_Release(void *ptr, MD_u64 size) //////////////////////////////////////////////////////////////////////////////// //- linux headers -#if (MD_DEFAULT_FILE_ITER || MD_DEFAULT_MEMORY) && MD_OS_LINUX +#if (MD_DEFAULT_FILE_ITER || MD_DEFAULT_MEMORY) && (MD_OS_LINUX || MD_OS_MAC) # include # include # include @@ -288,8 +288,12 @@ MD_WIN32_Release(void *ptr, MD_u64 size) # ifndef O_PATH # define O_PATH 010000000 # endif -# define AT_NO_AUTOMOUNT 0x800 -# define AT_SYMLINK_NOFOLLOW 0x100 +# ifndef AT_NO_AUTOMOUNT +# define AT_NO_AUTOMOUNT 0x800 +# endif +# ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 0x100 +# endif #endif //- linux "file iteration" @@ -361,7 +365,7 @@ MD_LINUX_FileIterIncrement(MD_Arena *arena, MD_FileIter *opaque_it, MD_String8 p #endif //- linux "low level memory" -#if MD_DEFAULT_MEMORY && MD_OS_LINUX +#if MD_DEFAULT_MEMORY && (MD_OS_LINUX || MD_OS_MAC) #if !defined(MD_IMPL_Reserve) # define MD_IMPL_Reserve MD_LINUX_Reserve diff --git a/source/md.h b/source/md.h index a7da6f5..7a94ee9 100644 --- a/source/md.h +++ b/source/md.h @@ -975,7 +975,7 @@ MD_FUNCTION MD_String8 MD_S8(MD_u8 *str, MD_u64 size); #endif #define MD_S8LitComp(s) {(MD_u8 *)(s), sizeof(s)-1} -#if MD_CPP_VERSION >= 11 +#if MD_CPP_VERSION != 0 && MD_CPP_VERSION != 98 // anything C++11 and up static inline MD_String8 operator "" _md(const char *s, size_t size) { diff --git a/tests/cpp_build_test.cpp b/tests/cpp_build_test.cpp index 09c4501..820e359 100644 --- a/tests/cpp_build_test.cpp +++ b/tests/cpp_build_test.cpp @@ -11,9 +11,12 @@ int main(void) printf("%d\n", MD_CPP_VERSION); +#if MD_CPP_VERSION != 0 && MD_CPP_VERSION != 98 // anything C++11 and up MD_String8 foo = "foo"_md; MD_String8 bar = "bar"_md; MD_String8 str = MD_S8Fmt(arena, "%S%S", foo, bar); printf("%.*s", MD_S8VArg(str)); +#endif + return 0; }