[Qt-interest] 64-bit conditional compile

Berry Octave octave at octavious.servegame.org
Wed May 12 04:07:27 CEST 2010


Le mardi 11 mai 2010, vous avez écrit
> What is the Qt way to conditionally compile for 64-bit or 32-bit
> architectures?
> 
> qglobal.h has definitions for Q_WS_MAC64 and Q_OS_WIN64, but I don't
> see anything for generic 64-bit compile.
> 
> Thanks!
> 
> John Weeks
> 
> WaveMetrics, Inc.
> Phone (503) 620-3001
> Fax   (503) 620-6754
> email   support at WaveMetrics.com

A trick would be to use the pointer size.

if (sizeof(void *) == 4)
	// Do 32bits stuff

if (sizeof(void *) == 8)
	// Do 64 bits stuff.

Regards
Berry Octave






More information about the Qt-interest-old mailing list