How to How the Compilation Arch inside Qt
-
QSysInfo::WordSize has the word size of the platform.
-
Hello.
I guess there is one way to achieve what you want. But it may be to difficult. Add new compilation step:Get output of GCC
Parse it
Put results into some header file
Include this file into you project
???
PROFIT
But I realy don't know how to make it, but I didn't ever try.
-
To be precise Tobias, QSysInfo::WordSize() gives you the compiled size. Here is some code I use in Windows to find if a 32 bit app is running in an enviroment that supports 64 bit apps:
@
int osPointerSize = QSysInfo::WordSize;
if ( osPointerSize == 32 ) {
BOOL bIsWow64 = FALSE;
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
LPFN_ISWOW64PROCESS fnIsWow64Process =
(LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle
(TEXT"kernel32")), "IsWow64Process");
if ( fnIsWow64Process != NULL ) {
if ( !fnIsWow64Process(GetCurrentProcess(), &bIsWow64) ) {
QMessageBox::warning(this, tr("System error"),
tr("Failed find WOW process"));
} else if ( bIsWow64 ) {
osPointerSize = 64;
}
}
}
@