[swift-users] A problem about interact with C macros

Li Keqing forucial at icloud.com
Sun Dec 17 06:08:23 CST 2017


Here are some macros in C headers such as

#define SITUATION1 0x00000001
#define SITUATION1 0x00000002
#define SITUATION3 0x00000004
#define SITUATION4 0x00000008
#define SITUATIONALL (SITUATION1 | SITUATION2 | SITUATION3 | SITUATION4)

when use these value in swift
those lines are okay
let value1 = SITUATION1
let value2 = SITUATION2
let value3 = SITUATION3
let value4 = SITUATION4
but this line would show error
let valueAll = SITUATIONALL

 Is it a bug ? or just be designed as it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171217/4489ffb3/attachment.html>


More information about the swift-users mailing list