• R/O
  • SSH
  • HTTPS

hamigaki: 提交


Commit MetaInfo

修訂1770 (tree)
時間2010-04-11 21:26:40
作者hamigaki

Log Message

supported x64

Change Summary

差異

--- hamigaki/trunk/libs/bjam/test/builtin_rules_test.cpp (revision 1769)
+++ hamigaki/trunk/libs/bjam/test/builtin_rules_test.cpp (revision 1770)
@@ -1,6 +1,6 @@
11 // builtin_rules_test.cpp: test case for bjam builtin rules
22
3-// Copyright Takeshi Mouri 2007, 2008.
3+// Copyright Takeshi Mouri 2007-2010.
44 // Distributed under the Boost Software License, Version 1.0.
55 // (See accompanying file LICENSE_1_0.txt or copy at
66 // http://www.boost.org/LICENSE_1_0.txt)
@@ -677,6 +677,19 @@
677677
678678 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
679679 #include <windows.h>
680+int get_native_system_arch()
681+{
682+ HMODULE hmod = ::GetModuleHandleA("kernel32.dll");
683+ FARPROC proc = ::GetProcAddress(hmod, "GetNativeSystemInfo");
684+ if (proc == 0)
685+ return 0;
686+
687+ typedef void (WINAPI *func_ptr_type)(SYSTEM_INFO*);
688+ func_ptr_type GetNativeSystemInfo = (func_ptr_type)proc;
689+ SYSTEM_INFO info;
690+ GetNativeSystemInfo(&info);
691+ return info.wProcessorArchitecture;
692+}
680693 void w32_getreg_test()
681694 {
682695 char win_dir[MAX_PATH];
@@ -685,6 +698,8 @@
685698 // should use SHGetSpecialFolderPath()
686699 std::string prog_dir(win_dir, 0, 3);
687700 prog_dir += "Program Files";
701+ if (get_native_system_arch() != 0)
702+ prog_dir += " (x86)";
688703
689704 ::OSVERSIONINFOA info;
690705 std::memset(&info, 0, sizeof(info));
Show on old repository browser