On 16/02/2013 03:54, Charles Hixson wrote:
Does D have an equivalent to the C marking of volatile?

Currently I'm just going to try removing all variables from the struct,
as it's never declared in D or accessed from within D, and I just want
to avoid cast(void*)s, but I may need to access something like this
sometime in the future.

In your case, I think you can declare opaque structs in D:

struct S;       //Opaque
struct S { ... }        //Not opaque

As for 'volatile', there's some info at http://dlang.org/deprecate.html#volatile about how it used to be available for marking statements as 'do not optimise field accesses'. The corrective action listed there is to use 'synchronized' instead. So probably your best bet is to use 'synchronized' blocks wherever you access the variables that you know are meant to be volatile.

Hope that helps :)

Reply via email to