Skip to content

Commit

Permalink
Fix compilation (MinGW)
Browse files Browse the repository at this point in the history
  • Loading branch information
SAPikachu committed Mar 11, 2015
1 parent cbadc9f commit 55bcc2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/f3kdb.h
Expand Up @@ -82,7 +82,7 @@ enum
# define F3KDB_EXTERNAL_API(ret) F3KDB_EXTERN_C ret F3KDB_CC
#endif

#if !defined(FLASH3KYUU_DEBAND_EXPORTS) && defined(_WIN32) && !defined(F3KDB_STATIC)
#if !defined(FLASH3KYUU_DEBAND_EXPORTS) && defined(_WIN32) && !defined(F3KDB_STATIC) && !defined(__GNUC__)
# define F3KDB_API(ret) F3KDB_EXTERN_C __declspec(dllimport) ret F3KDB_CC
#else
# define F3KDB_API(ret) F3KDB_EXTERNAL_API(ret)
Expand Down
18 changes: 10 additions & 8 deletions src/compiler_compat.h
Expand Up @@ -16,21 +16,23 @@
#define __PRAGMA_NOUNROLL__
#endif

#ifndef _WIN32
#define __forceinline inline
#ifndef __cdecl
#define __cdecl
#endif
#define InterlockedCompareExchangePointer(a,b,c) __sync_val_compare_and_swap(a,c,b)

#if defined(__GNUC__) || defined(__clang__)
#include <cstring>
#include <cstdlib>
#include <stdio.h>

#define stricmp strcasecmp
#define strnicmp strncasecmp
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#define _snprintf snprintf
#endif

#ifndef _WIN32
#define __forceinline inline
#ifndef __cdecl
#define __cdecl
#endif
#define InterlockedCompareExchangePointer(a,b,c) __sync_val_compare_and_swap(a,c,b)

static inline void* _aligned_malloc(size_t size, size_t alignment)
{
Expand Down

0 comments on commit 55bcc2c

Please sign in to comment.