the.bay.news

C-derived constants in integer literal expressions

Swift Forums
C-derived constants in integer literal expressions
Hi all. I'm working on migrating an embedded C project to use embedded Swift. This C project uses KConfig and therefore defines constants using #define macros #define CONFIG_LED_PANEL_WIDTH 80 #define CONFIG_LED_PANEL_WIDTH 24 I would like to use these constants to define a "framebuffer" inline array struct FrameBuffer { private let pixels: [(CONFIG_LED_PANEL_WIDTH * CONFIG_LED_PANEL_HEIGHT) of AbstractColor] } However, I cannot do this, because integer #define macros are CInt aka Int32 ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.