Skip to content

Commit

Permalink
Add MinGW port
Browse files Browse the repository at this point in the history
  • Loading branch information
podsvirov committed Apr 18, 2021
1 parent 0c4c460 commit 4058497
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/s2/base/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ inline void sized_delete_array(void *ptr, size_t size) {

#endif

// defines __BYTE_ORDER for MSVC
#ifdef _MSC_VER
// defines __BYTE_ORDER for _WIN32
#ifdef _WIN32
#define __BYTE_ORDER __LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN
#else
Expand All @@ -317,7 +317,7 @@ inline void sized_delete_array(void *ptr, size_t size) {
#endif

#endif // __BYTE_ORDER
#endif // _MSC_VER
#endif // _WIN32

// byte swap functions (bswap_16, bswap_32, bswap_64).

Expand Down Expand Up @@ -602,11 +602,11 @@ std::ostream &operator<<(std::ostream &out, const pthread_t &thread_id);
#endif // _MSC_VER

// random, srandom
#ifdef _MSC_VER
#ifdef _WIN32
// You say tomato, I say toma
inline int random() { return rand(); }
inline void srandom(unsigned int seed) { srand(seed); }
#endif // _MSC_VER
#endif // _WIN32

// bcopy, bzero
#ifdef _MSC_VER
Expand Down Expand Up @@ -888,7 +888,7 @@ inline void UnalignedCopy64(const void *src, void *dst) {
defined(__NVCC__)) && \
!defined(SWIG)) || \
((__GNUC__ >= 3 || defined(__clang__)) && defined(__ANDROID__)) || \
defined(__ASYLO__))
defined(__ASYLO__)) && !defined(__MINGW32__)
inline void *aligned_malloc(size_t size, size_t minimum_alignment) {
#if defined(__ANDROID__) || defined(OS_ANDROID) || defined(__ASYLO__)
return memalign(minimum_alignment, size);
Expand Down

0 comments on commit 4058497

Please sign in to comment.