mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-09-03 01:03:29 +02:00
trabucayre/openFPGALoader#38 minor adjustments for MinGW build - use memset instead of bzero, errno_t may be replaced by int, provide ad-hoc ntohs on windows (alternative is link against winsock)
This commit is contained in:
@@ -2,7 +2,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#ifndef _WIN32
|
||||
#include <arpa/inet.h>
|
||||
#else
|
||||
// WARNING: this will be incorrect on ARM-based windows platforms
|
||||
// that are big-endian, but the rest of this code has not been tested for
|
||||
// those platforms anyway.
|
||||
uint16_t ntohs(uint16_t netshort) {
|
||||
return ((netshort & 0xFF) << 8) | ((netshort & 0xFF00) >> 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user