Skip to content

Commit 2709ea2

Browse files
committed
Added ability to compile with MSVC
1 parent bf66814 commit 2709ea2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/JPEGDEC.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//
1414
#ifndef __JPEGDEC__
1515
#define __JPEGDEC__
16-
#if defined( __MACH__ ) || defined( __LINUX__ ) || defined( __MCUXPRESSO ) || defined( ESP_PLATFORM )
16+
#if defined( __MACH__ ) || defined( __LINUX__ ) || defined( __MCUXPRESSO ) || defined( ESP_PLATFORM ) || defined(_WIN64)
1717
#include <stdlib.h>
1818
#include <string.h>
1919
#include <stdint.h>
@@ -28,6 +28,12 @@
2828
#define memcpy_P memcpy
2929
#define PROGMEM
3030
#endif
31+
#ifdef _M_X64 //MSVC
32+
#define __x86_64__
33+
#define __builtin_bswap16 _byteswap_ushort
34+
#define __builtin_bswap64 _byteswap_uint64
35+
#define __builtin_bswap32 _byteswap_ulong
36+
#endif
3137
// Cortex-M4/M7 allow unaligned access to SRAM
3238
#if defined(HAL_ESP32_HAL_H_) || defined(TEENSYDUINO) || defined(ARM_MATH_CM4) || defined(ARM_MATH_CM7) || defined (__x86_64__) || defined(TEENSYDUINO)
3339
#define ALLOWS_UNALIGNED

0 commit comments

Comments
 (0)