Skip to content

Commit

Permalink
Fix defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jul 30, 2024
1 parent 1120584 commit 813620a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Dependencies/dxcompiler/include/WinAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
#define CoTaskMemAlloc malloc
#define CoTaskMemFree free

#ifndef ARRAYSIZE
#define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0]))
#endif // ARRAYSIZE

#define _countof(a) (sizeof(a) / sizeof(*(a)))

Expand Down Expand Up @@ -188,7 +186,7 @@

#define vsnprintf_s vsnprintf
#define strcat_s strcat
#define strcpy_s(dst, n, src) strncpy(dst, src, n)
#define strncpy_s(dst, n, src) strncpy(dst, src, n)
#define _vscwprintf vwprintf
#define vswprintf_s vswprintf
#define swprintf_s swprintf
Expand Down
2 changes: 1 addition & 1 deletion Dependencies/dxcompiler/include/dxcapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <dlfcn.h>
#if !WIN32
#undef strcpy_s
#undef strncpy_s
#undef ARRAYSIZE
#endif
#include "WinAdapter.h"
Expand Down
4 changes: 4 additions & 0 deletions Source/Base/Base/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ static_assert(false, "Please add PRAGMA_ENABLE_OPTIMIZATION/PRAGMA_DISABLE_OPTIM
#endif

#if !WIN32
#ifndef strcpy_s
#define strcpy_s(dest, count) strcpy((dest), (count))
#endif // strcpy_s
#ifndef ARRAYSIZE
#define ARRAYSIZE(arr) (sizeof(arr)/sizeof(arr[0]))
#endif // ARRAYSIZE
#endif

0 comments on commit 813620a

Please sign in to comment.