This code determines if the processor is an AMD 64 bit system, an ia64 system or an Intel 32 bit system.
Signed-off-by: Darryl L. Pierce dpierce@redhat.com --- src/host.cpp | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/host.cpp b/src/host.cpp index 730529c..396818d 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -249,10 +249,25 @@ host_get_architecture()
#elif defined WIN32
- // TODO this should be more explicit and determine if - // the compiler is using a 64-bit target in future. - architecture = string("Win32"); + LPSYSTEM_INFO system_info;
+ GetSystemInfo(&system_info); + + switch(system_info.wProcessorArchitecture) + { + case PROCESSOR_ARCHITECTURE_AMD64: + architecture = "x86 (AMD)"; + break; + case PROCESSOR_ARCHITECTURE_IA64: + architecture = "ia64"; + break; + case PROCESSOR_ARCHITECTURE_INTEL: + architecture = "x86 (Intel)"; + break; + case PROCESSOR_ARCHITECTURE_UNKNOWN: + architecture = "Unknown"; + break; + } #endif }
On Wed, Aug 04, 2010 at 04:20:50PM -0400, Darryl L. Pierce wrote:
This code determines if the processor is an AMD 64 bit system, an ia64 system or an Intel 32 bit system.
Signed-off-by: Darryl L. Pierce dpierce@redhat.com
src/host.cpp | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-)
This is now pushed upstream.
matahari@lists.fedorahosted.org