rockchip-linux / rkdeveloptool

GNU General Public License v2.0
146 stars 85 forks source link

fix building with mingw-w64 #56

Open WinterMute opened 3 years ago

WinterMute commented 3 years ago

Some relatively minor fixes to get this building for windows using mingw-w64

libusb.h pulls in windows.h on windows which has it's own typedefs for BYTE, UCHAR etc. DWORD is typedef'd as unsigned long though which causes build errors despite LLP64 meaning that long & int are the same size. Replacing the problem variables with UINT works fine.

defining _POSIX_THREAD_SAFE_FUNCTIONS enables localtime_r in the mingw-w64 headers.

mightymos commented 2 years ago

Thanks for this, compiles on Windows 10.

EDIT: Working for orange pi 4 lts (rk3399), if libwdi (zadig) is used to replace rockchip driver with WinUSB: https://github.com/pbatard/libwdi/releases