使用不同类型的typedef重新定义('uint_least16_t'(又名'unsigned short')vs'char16_t')

时间:2016-04-19 07:21:16

标签: c++ objective-c swift xcode7 swift2.2

我的项目包含Swift 2.2,Objective C和C ++ with Xcode 7.3

我在生成的ProducModuleName-Swift.h文件中收到以下错误

Typedef redefinition with different types ('uint_least16_t' (aka 'unsigned short') vs 'char16_t')
Typedef redefinition with different types ('uint_least32_t' (aka 'unsigned int') vs 'char32_t')

在以下部分

if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if defined(__has_include) && __has_include(<uchar.h>)
#  include <uchar.h>
# elif !defined(__cplusplus) || __cplusplus < 201103L
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif

我可以通过将C ++ parms更改为C ++ 11来绕过错误,这将跳过这个麻烦的代码。

但是我想知道是否有更清洁的解决方案。

**enter image description here**

澄清上面的代码是XCode在编译时生成的代码。我无法控制这段代码

0 个答案:

没有答案