What's the best way to specify structure layout difference on architectures? #55534
Answered
by
jkotas
huoyaoyuan
asked this question in
Q&A
-
When trying to modernize P/Invoke in System.Drawing.Common, I saw this: Win32 and Win64 uses different packing size for the struct (confirmed in commdlg.h). This is not easy to define in managed code. Defining two types like this looks very error-prone. Does it worth compiling separately for different archs? |
Beta Was this translation helpful? Give feedback.
Answered by
jkotas
Jun 6, 2021
Replies: 1 comment
-
You can define two types, but hide the difference behind interface. #33899 has real world example of this technique. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jkoritzinsky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can define two types, but hide the difference behind interface. #33899 has real world example of this technique.