提交 ffbe0a85 编写于 作者: B Behdad Esfahbod

More MSVC fixes from Jonathan Kew

上级 d3480ba3
...@@ -28,13 +28,18 @@ ...@@ -28,13 +28,18 @@
#define HB_COMMON_H #define HB_COMMON_H
#ifdef _MSC_VER #ifdef _MSC_VER
#warning "Not using stdint.h. Integer types may have wrong size." #define __STR2__(x) #x
#define __STR1__(x) __STR2__(x)
#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: "
#pragma message(__LOC__"Not using stdint.h; integer types may have wrong size")
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef signed int int32_t; typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef __cplusplus #ifndef __cplusplus
#define inline __inline #define inline __inline
#endif #endif
......
...@@ -65,8 +65,13 @@ typedef GStaticMutex hb_mutex_t; ...@@ -65,8 +65,13 @@ typedef GStaticMutex hb_mutex_t;
#define hb_mutex_trylock(M) g_static_mutex_trylock (&M) #define hb_mutex_trylock(M) g_static_mutex_trylock (&M)
#define hb_mutex_unlock(M) g_static_mutex_unlock (&M) #define hb_mutex_unlock(M) g_static_mutex_unlock (&M)
#else
#ifdef _MSC_VER
#pragma message(__LOC__"Could not find any system to define platform macros, library will NOT be thread-safe")
#else #else
#warning "Could not find any system to define platform macros, library will NOT be thread-safe" #warning "Could not find any system to define platform macros, library will NOT be thread-safe"
#endif
typedef int hb_atomic_int_t; typedef int hb_atomic_int_t;
#define hb_atomic_int_fetch_and_add(AI, V) ((AI) += (V), (AI) - (V)) #define hb_atomic_int_fetch_and_add(AI, V) ((AI) += (V), (AI) - (V))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册