Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-cl support. #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions incbin.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
#define INCBIN_VA_ARG_COUNTER(_1, _2, _3, N, ...) N
#define INCBIN_VA_ARGC(...) INCBIN_VA_ARG_COUNTER(__VA_ARGS__, 3, 2, 1, 0)

#if defined(_MSC_VER)
# if defined(__clang__)
# define INCBIN_CLANGCL 1
# else
# define INCBIN_MSCL 1
# endif
#endif

/* Green Hills uses a different directive for including binary data */
#if defined(__ghs__)
# if (__ghs_asm == 2)
Expand All @@ -82,7 +90,7 @@
# define INCBIN_MACRO ".incbin"
#endif

#ifndef _MSC_VER
#ifndef INCBIN_MSCL
# define INCBIN_ALIGN \
__attribute__((aligned(INCBIN_ALIGNMENT)))
#else
Expand Down Expand Up @@ -174,7 +182,7 @@
# define INCBIN_TYPE(...)
#else
# define INCBIN_SECTION ".section " INCBIN_OUTPUT_SECTION "\n"
# define INCBIN_GLOBAL(NAME) ".global " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME "\n"
# define INCBIN_GLOBAL(NAME) ".global " INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME "\n"
# if defined(__ghs__)
# define INCBIN_INT ".word "
# else
Expand All @@ -191,6 +199,8 @@
# elif defined(__MINGW32__) || defined(__MINGW64__)
/* Mingw doesn't support this directive either */
# define INCBIN_TYPE(NAME)
# elif defined(INCBIN_CLANGCL)
# define INCBIN_TYPE(NAME)
# else
/* It's safe to use `@' on other architectures */
# define INCBIN_TYPE(NAME) ".type " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME ", @object\n"
Expand Down Expand Up @@ -396,7 +406,7 @@
* To externally reference the data included by this in another translation unit
* please @see INCBIN_EXTERN.
*/
#ifdef _MSC_VER
#ifdef INCBIN_MSCL
# define INCBIN(NAME, FILENAME) \
INCBIN_EXTERN(NAME)
#else
Expand Down Expand Up @@ -465,7 +475,7 @@
* To externally reference the data included by this in another translation unit
* please @see INCBIN_EXTERN.
*/
#if defined(_MSC_VER)
#if defined(INCBIN_MSCL)
# define INCTXT(NAME, FILENAME) \
INCBIN_EXTERN(NAME)
#else
Expand Down