Different struct attribute based 32bit or 64bit
<p>Is there a way I can apply an attribute to a struct conditionally?</p>

<p>If the machine is <strong>32bit</strong> I want to apply this attribute</p>

<p><code>[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]</code></p>

<p>If the machine is <strong>64bit</strong> I want to apply this attribute</p>

<p><code>[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]</code></p>

<p>Or alternatively could I substitute a value within the attribute...</p>

<p><strong>32bit</strong> (Pack = 2)</p>

<p><code>[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]</code></p>

<p><strong>64bit</strong> (Pack = 8)</p>

<p><code>[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)]</code></p>

<p>I tried using this <a href="http://msdn.microsoft.com/en-us/library/z919e8tw%28v=vs.80%29.aspx" rel="nofollow">example</a> but it’s for custom attributes, not existing ones.</p>

<p><strong>Update:</strong></p>

<ul>
<li>I'd like to comile to "Any CPU"</li>
<li>The attribute is for the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795%28v=vs.85%29.aspx" rel="nofollow">SHFILEOPSTRUCT</a> and depending on the processor uses either or.</li>
<li>I don't want to have to compile two versions.</li>
</ul>
