I wrote a low level audio player using CoreAudio in c# using xamarin.iOS.
In one of the classes, I have two volatile pointers in the following manner:
public unsafe volatile short* readPointer;
public unsafe volatile short* writePointer;
And the entire program compiles and works quite well.
I also set up a Jenkins build machine so it invokes mdtool
on my project file to build it in AdHoc mode. However, when I build in this manner, I am getting the following error:
Build complete -- 2 errors, 0 warnings
MixerChannel.cs(21,39) : error CS0677: `MixerChannel.readPointer': A volatile field cannot be of the type `short*'
MixerChannel.cs(22,39) : error CS0677: `MixerChannel.writePointer': A volatile field cannot be of the type `short*'
According to MSDN, I am able to create volatile
fields of the following types:
- Any reference type
- Any pointer type (in an unsafe context)
- The types sbyte, byte, short, ushort, int, uint, char, float, bool
- Enum types based on any of the above types
But this error seems to state otherwise.
The Jenkins build machine is exactly the same I use to build to debug. However, the build process is different: for debugging, I'm using the xamarin build host, and building from a Windows box with Visual Studio 2010. For the Jenkins build, I am using mdtool
invoked remotely from the same Window box using plink
.
Am I missing something obvious here? I strongly believe that compiler writers are demigods, and therefore any error is almost surely in my own code and not in the compiler.