Skip to content

hsc2hs parses incorrectly '#ifdef' under '#{enum' in '--cross-compile' mode

The code is simplified version of something from Win32 package (https://github.com/haskell/win32/blob/master/System/Win32/SimpleMAPI.hsc#L56):

#{enum Int ,
 , a       = sizeof(int)
#if 0
 , b       = sizeof(char)
#endif
 }
$ hsc2hs b.hsc -o b.hs-native
$ hsc2hs b.hsc -o b.hs-cross --cross-compile
b.hsc:1  sizeof(int)
#if 0
  is not an integer

I'm not sure if it's a valid .hsc but having at least the same (valid or invalid) result in both modes would be nice.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component hsc2hs
Test case
Differential revisions
BlockedBy
Related
Blocking
CC Phyx-, hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information