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

Try to correctly guess a 64 bit target #67

Open
wants to merge 2 commits 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: 15 additions & 3 deletions incbin.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
*/
#ifndef INCBIN_HDR
#define INCBIN_HDR

#if !defined(_MSC_VER) || defined(__clang__)
# include <stdint.h>
# if defined(UINTPTR_MAX) && defined(UINT64_MAX) && !defined(__LP64__)
# if UINTPTR_MAX == UINT64_MAX
# define __LP64__ 1
# endif
# endif
#endif

#include <limits.h>
#if defined(__AVX512BW__) || \
defined(__AVX512CD__) || \
Expand All @@ -30,9 +40,11 @@
defined(__ARM_NEON) || \
defined(__ALTIVEC__)
# define INCBIN_ALIGNMENT_INDEX 4
#elif ULONG_MAX != 0xffffffffu
#elif defined(__LP64__) || \
defined(_LP64) || \
defined(_WIN64)
# define INCBIN_ALIGNMENT_INDEX 3
# else
#else
# define INCBIN_ALIGNMENT_INDEX 2
#endif

Expand Down Expand Up @@ -473,4 +485,4 @@
INCBIN_COMMON(char, NAME, FILENAME, INCBIN_BYTE "0\n")
#endif

#endif
#endif