So rather use:
~~~
#if defined(POLARSSL_SHA512_C) && !defined(POLARSSL_ENTROPY_SHA256_ACCUMULATOR)
~~~
to match the 'internal knowledge' about config options..