kwsysPlatformTestsCXX.cxx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. // Setup for tests that use result of stl namespace test.
  11. #if defined(KWSYS_STL_HAVE_STD)
  12. # if KWSYS_STL_HAVE_STD
  13. # define kwsys_stl std
  14. # else
  15. # define kwsys_stl
  16. # endif
  17. #endif
  18. // Setup for tests that use iostreams.
  19. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD)
  20. # if defined(_MSC_VER)
  21. # pragma warning (push,1)
  22. # endif
  23. # if KWSYS_IOS_USE_ANSI
  24. # include <iostream>
  25. # else
  26. # include <iostream.h>
  27. # endif
  28. # if defined(_MSC_VER)
  29. # pragma warning (pop)
  30. # endif
  31. # if KWSYS_IOS_HAVE_STD
  32. # define kwsys_ios std
  33. # else
  34. # define kwsys_ios
  35. # endif
  36. #endif
  37. #ifdef TEST_KWSYS_STL_HAVE_STD
  38. #include <list>
  39. void f(std ::list<int>*) {}
  40. int main() { return 0; }
  41. #endif
  42. #ifdef TEST_KWSYS_IOS_USE_ANSI
  43. #include <iosfwd>
  44. int main() { return 0; }
  45. #endif
  46. #ifdef TEST_KWSYS_IOS_HAVE_STD
  47. #include <iosfwd>
  48. void f(std ::ostream*) {}
  49. int main() { return 0; }
  50. #endif
  51. #ifdef TEST_KWSYS_IOS_USE_SSTREAM
  52. #include <sstream>
  53. #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96
  54. # error "GCC 2.96 stringstream is buggy"
  55. #endif
  56. int main()
  57. {
  58. std ::ostringstream ostr;
  59. ostr << "hello";
  60. if(ostr.str().size() == 5)
  61. {
  62. return 0;
  63. }
  64. return -1;
  65. }
  66. #endif
  67. #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H
  68. #include <strstream.h>
  69. int main() { return 0; }
  70. #endif
  71. #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H
  72. #include <strstrea.h>
  73. int main() { return 0; }
  74. #endif
  75. #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM
  76. # include <iostream.h>
  77. # include <string>
  78. void f(ostream& os, const kwsys_stl::string& s) { os << s; }
  79. int main() { return 0; }
  80. #endif
  81. #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM
  82. # include <iostream.h>
  83. # include <string>
  84. void f(istream& is, kwsys_stl::string& s) { is >> s; }
  85. int main() { return 0; }
  86. #endif
  87. #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR
  88. # include <string>
  89. bool f(const kwsys_stl::string& s) { return s != ""; }
  90. int main() { return 0; }
  91. #endif
  92. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  93. #include <cstdio>
  94. int main() { return 0; }
  95. #endif
  96. #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF
  97. #include <cstddef>
  98. void f(size_t) {}
  99. int main() { return 0; }
  100. #endif
  101. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  102. long long f(long long n) { return n; }
  103. int main()
  104. {
  105. long long n = 0;
  106. return static_cast<int>(f(n));
  107. }
  108. #endif
  109. #ifdef TEST_KWSYS_CXX_HAS___INT64
  110. __int64 f(__int64 n) { return n; }
  111. int main()
  112. {
  113. __int64 n = 0;
  114. return static_cast<int>(f(n));
  115. }
  116. #endif
  117. #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
  118. template <class T> class A;
  119. template <class T> int f(A<T>&);
  120. template <class T> class A
  121. {
  122. public:
  123. // "friend int f<>(A<T>&)" would conform
  124. friend int f(A<T>&);
  125. private:
  126. int x;
  127. };
  128. template <class T> int f(A<T>& a) { return a.x = 0; }
  129. template int f(A<int>&);
  130. int main()
  131. {
  132. A<int> a;
  133. return f(a);
  134. }
  135. #endif
  136. #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES
  137. template <class U>
  138. class A
  139. {
  140. public:
  141. U u;
  142. A(): u(0) {}
  143. template <class V> V m(V* p) { return *p = u; }
  144. };
  145. int main()
  146. {
  147. A<short> a;
  148. int s = 1;
  149. return a.m(&s);
  150. }
  151. #endif
  152. #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION
  153. template <class T> struct A {};
  154. template <> struct A<int*>
  155. {
  156. static int f() { return 0; }
  157. };
  158. int main() { return A<int*>::f(); }
  159. #endif
  160. #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
  161. namespace N
  162. {
  163. class A {};
  164. int f(A*) { return 0; }
  165. }
  166. void f(void*);
  167. int main()
  168. {
  169. N::A* a = 0;
  170. return f(a);
  171. }
  172. #endif
  173. #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS
  174. #include <iterator>
  175. #include <list>
  176. void f(kwsys_stl::iterator_traits<kwsys_stl::list<int>::iterator>::iterator_category const&) {}
  177. int main() { return 0; }
  178. #endif
  179. #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY
  180. #include <iterator>
  181. #include <list>
  182. void f(kwsys_stl::list<int>::iterator x) { kwsys_stl::iterator_category(x); }
  183. int main() { return 0; }
  184. #endif
  185. #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY
  186. #include <iterator>
  187. #include <list>
  188. void f(kwsys_stl::list<int>::iterator x) { kwsys_stl::__iterator_category(x); }
  189. int main() { return 0; }
  190. #endif
  191. #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
  192. #include <memory>
  193. template <class Alloc>
  194. void f(const Alloc&)
  195. {
  196. typedef typename Alloc::size_type alloc_size_type;
  197. }
  198. int main()
  199. {
  200. f(kwsys_stl::allocator<char>());
  201. return 0;
  202. }
  203. #endif
  204. #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
  205. #include <memory>
  206. void f(kwsys_stl::allocator::size_type const&) {}
  207. int main() { return 0; }
  208. #endif
  209. #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND
  210. #include <memory>
  211. template <class T, class Alloc>
  212. void f(const T&, const Alloc&)
  213. {
  214. typedef typename Alloc::template rebind<T>::other alloc_type;
  215. }
  216. int main()
  217. {
  218. f(0, kwsys_stl::allocator<char>());
  219. return 0;
  220. }
  221. #endif
  222. #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
  223. #include <memory>
  224. void f(kwsys_stl::allocator<char> const& a)
  225. {
  226. a.max_size(sizeof(int));
  227. }
  228. int main()
  229. {
  230. f(kwsys_stl::allocator<char>());
  231. return 0;
  232. }
  233. #endif
  234. #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS
  235. #include <vector>
  236. void f(kwsys_stl::vector<int> const& v1)
  237. {
  238. kwsys_stl::vector<int>(1, 1, v1.get_allocator());
  239. }
  240. int main()
  241. {
  242. f(kwsys_stl::vector<int>());
  243. return 0;
  244. }
  245. #endif
  246. #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM
  247. #include <sys/types.h>
  248. #include <sys/stat.h>
  249. #include <unistd.h>
  250. int main()
  251. {
  252. struct stat stat1;
  253. (void)stat1.st_mtim.tv_sec;
  254. (void)stat1.st_mtim.tv_nsec;
  255. return 0;
  256. }
  257. #endif
  258. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  259. void function(long**) {}
  260. int main()
  261. {
  262. __int64** p = 0;
  263. function(p);
  264. return 0;
  265. }
  266. #endif
  267. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  268. void function(long long**) {}
  269. int main()
  270. {
  271. __int64** p = 0;
  272. function(p);
  273. return 0;
  274. }
  275. #endif
  276. #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE
  277. void function(double& l, unsigned __int64 const& r)
  278. {
  279. l = static_cast<double>(r);
  280. }
  281. int main()
  282. {
  283. double tTo = 0.0;
  284. unsigned __int64 tFrom = 0;
  285. function(tTo, tFrom);
  286. return 0;
  287. }
  288. #endif
  289. #ifdef TEST_KWSYS_IOS_HAVE_BINARY
  290. int test_binary(int, ...)
  291. {
  292. return 0;
  293. }
  294. int main()
  295. {
  296. return test_binary(1, kwsys_ios::ios::binary);
  297. }
  298. #endif
  299. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  300. int test_istream(kwsys_ios::istream& is, long long& x)
  301. {
  302. return (is >> x)? 1:0;
  303. }
  304. int main()
  305. {
  306. long long x = 0;
  307. return test_istream(kwsys_ios::cin, x);
  308. }
  309. #endif
  310. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  311. int test_ostream(kwsys_ios::ostream& os, long long x)
  312. {
  313. return (os << x)? 1:0;
  314. }
  315. int main()
  316. {
  317. long long x = 0;
  318. return test_ostream(kwsys_ios::cout, x);
  319. }
  320. #endif
  321. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  322. int test_istream(kwsys_ios::istream& is, __int64& x)
  323. {
  324. return (is >> x)? 1:0;
  325. }
  326. int main()
  327. {
  328. __int64 x = 0;
  329. return test_istream(kwsys_ios::cin, x);
  330. }
  331. #endif
  332. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  333. int test_ostream(kwsys_ios::ostream& os, __int64 x)
  334. {
  335. return (os << x)? 1:0;
  336. }
  337. int main()
  338. {
  339. __int64 x = 0;
  340. return test_ostream(kwsys_ios::cout, x);
  341. }
  342. #endif
  343. #ifdef TEST_KWSYS_CHAR_IS_SIGNED
  344. /* Return 0 for char signed and 1 for char unsigned. */
  345. int main()
  346. {
  347. unsigned char uc = 255;
  348. return (*reinterpret_cast<char*>(&uc) < 0)?0:1;
  349. }
  350. #endif
  351. #ifdef TEST_KWSYS_LFS_WORKS
  352. /* Return 0 when LFS is available and 1 otherwise. */
  353. #define _LARGEFILE_SOURCE
  354. #define _LARGEFILE64_SOURCE
  355. #define _LARGE_FILES
  356. #define _FILE_OFFSET_BITS 64
  357. #include <sys/types.h>
  358. #include <sys/stat.h>
  359. #include <assert.h>
  360. #if KWSYS_CXX_HAS_CSTDIO
  361. # include <cstdio>
  362. #endif
  363. #include <stdio.h>
  364. int main(int, char **argv)
  365. {
  366. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  367. #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  368. if (OFF_T_64 % 2147483647 != 1)
  369. return 1;
  370. // stat breaks on SCO OpenServer
  371. struct stat buf;
  372. stat( argv[0], &buf );
  373. if (!S_ISREG(buf.st_mode))
  374. return 2;
  375. FILE *file = fopen( argv[0], "r" );
  376. off_t offset = ftello( file );
  377. fseek( file, offset, SEEK_CUR );
  378. fclose( file );
  379. return 0;
  380. }
  381. #endif
  382. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  383. #include <stdlib.h>
  384. int main()
  385. {
  386. return setenv("A", "B", 1);
  387. }
  388. #endif
  389. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  390. #include <stdlib.h>
  391. int main()
  392. {
  393. unsetenv("A");
  394. return 0;
  395. }
  396. #endif
  397. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  398. #include <stdlib.h>
  399. int main()
  400. {
  401. char* e = environ[0];
  402. return e? 0:1;
  403. }
  404. #endif
  405. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  406. // Match feature definitions from SystemInformation.cxx
  407. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  408. # define _GNU_SOURCE
  409. #endif
  410. #include <stdlib.h>
  411. int main()
  412. {
  413. double loadavg[3] = { 0.0, 0.0, 0.0 };
  414. return getloadavg(loadavg, 3);
  415. }
  416. #endif
  417. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  418. # if defined(KWSYS_HAS_LFS)
  419. # define _LARGEFILE_SOURCE
  420. # define _LARGEFILE64_SOURCE
  421. # define _LARGE_FILES
  422. # define _FILE_OFFSET_BITS 64
  423. # endif
  424. # include <sys/resource.h>
  425. int main()
  426. {
  427. struct rlimit64 rlim;
  428. return getrlimit64(0,&rlim);
  429. }
  430. #endif
  431. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  432. #include <stdlib.h>
  433. int main()
  434. {
  435. const char *str="1024";
  436. return static_cast<int>(atoll(str));
  437. }
  438. #endif
  439. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  440. #include <stdlib.h>
  441. int main()
  442. {
  443. const char *str="1024";
  444. return static_cast<int>(atol(str));
  445. }
  446. #endif
  447. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  448. #include <stdlib.h>
  449. int main()
  450. {
  451. const char *str="1024";
  452. return static_cast<int>(_atoi64(str));
  453. }
  454. #endif
  455. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  456. #include <sys/time.h>
  457. int main()
  458. {
  459. struct timeval* current_time = 0;
  460. return utimes("/example", current_time);
  461. }
  462. #endif
  463. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  464. #include <fcntl.h>
  465. #include <sys/stat.h>
  466. int main()
  467. {
  468. struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}};
  469. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  470. }
  471. #endif
  472. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  473. #if defined(__PATHSCALE__) || defined(__PATHCC__) \
  474. || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  475. backtrace doesnt work with this compiler or os
  476. #endif
  477. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  478. # define _GNU_SOURCE
  479. #endif
  480. #include <execinfo.h>
  481. int main()
  482. {
  483. void *stackSymbols[256];
  484. backtrace(stackSymbols,256);
  485. backtrace_symbols(&stackSymbols[0],1);
  486. return 0;
  487. }
  488. #endif
  489. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  490. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  491. # define _GNU_SOURCE
  492. #endif
  493. #include <dlfcn.h>
  494. int main()
  495. {
  496. Dl_info info;
  497. int ierr=dladdr((void*)main,&info);
  498. return 0;
  499. }
  500. #endif
  501. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  502. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  503. # define _GNU_SOURCE
  504. #endif
  505. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \
  506. && __linux && __SUNPRO_CC_COMPAT == 'G'
  507. # include <iostream>
  508. #endif
  509. #include <cxxabi.h>
  510. int main()
  511. {
  512. int status = 0;
  513. size_t bufferLen = 512;
  514. char buffer[512] = {'\0'};
  515. const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii";
  516. char *demangledFunction =
  517. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  518. return status;
  519. }
  520. #endif
  521. #ifdef TEST_KWSYS_CXX_TYPE_INFO
  522. /* Collect fundamental type information and save it to a CMake script. */
  523. /* Include limits.h to get macros indicating long long and __int64.
  524. Note that certain compilers need special macros to define these
  525. macros in limits.h. */
  526. #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
  527. # define _MSC_EXTENSIONS
  528. #endif
  529. #if defined(__GNUC__) && __GNUC__ < 3
  530. # define _GNU_SOURCE
  531. #endif
  532. #include <limits.h>
  533. #include <stdio.h>
  534. #include <string.h>
  535. /* Due to shell differences and limitations of ADD_DEFINITIONS the
  536. KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes
  537. and sometimes not. This macro will make sure the value is treated
  538. as a double-quoted string. */
  539. #define TO_STRING(x) TO_STRING0(x)
  540. #define TO_STRING0(x) TO_STRING1(x)
  541. #define TO_STRING1(x) #x
  542. void f() {}
  543. int main()
  544. {
  545. /* Construct the output file name. Some preprocessors will add an
  546. extra level of double quotes, so strip them. */
  547. char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE);
  548. char* fname = fbuf;
  549. if(fname[0] == '"')
  550. {
  551. ++fname;
  552. int len = static_cast<int>(strlen(fname));
  553. if(len > 0 && fname[len-1] == '"')
  554. {
  555. fname[len-1] = 0;
  556. }
  557. }
  558. /* Try to open the output file. */
  559. if(FILE* fout = fopen(fname, "w"))
  560. {
  561. /* Set the size of standard types. */
  562. fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast<int>(sizeof(char)));
  563. fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast<int>(sizeof(short)));
  564. fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast<int>(sizeof(int)));
  565. fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast<int>(sizeof(long)));
  566. /* Set the size of some non-standard but common types. */
  567. /* Check for a limits.h macro for long long to see if the type exists. */
  568. #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX)
  569. fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast<int>(sizeof(long long)));
  570. #else
  571. fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n");
  572. #endif
  573. /* Check for a limits.h macro for __int64 to see if the type exists. */
  574. #if defined(_I64_MIN)
  575. fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast<int>(sizeof(__int64)));
  576. #else
  577. fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n");
  578. #endif
  579. /* Set the size of some pointer types. */
  580. fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast<int>(sizeof(void*)));
  581. fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast<int>(sizeof(&f)));
  582. /* Set whether the native type "char" is signed or unsigned. */
  583. unsigned char uc = 255;
  584. fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n",
  585. (*reinterpret_cast<char*>(&uc) < 0)?1:0);
  586. fclose(fout);
  587. return 0;
  588. }
  589. else
  590. {
  591. fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n",
  592. fname);
  593. return 1;
  594. }
  595. }
  596. #endif
  597. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  598. int main()
  599. {
  600. int a = 1;
  601. __asm {
  602. xor EBX, EBX;
  603. mov a, EBX;
  604. }
  605. return a;
  606. }
  607. #endif
  608. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  609. int main()
  610. {
  611. int a = 0;
  612. __asm {
  613. xor EAX, EAX;
  614. cpuid;
  615. mov a, EAX;
  616. }
  617. return a;
  618. }
  619. #endif
  620. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  621. #include <string>
  622. void f(std ::wstring*) {}
  623. int main() { return 0; }
  624. #endif