1 | Checking whether '/opt/local/bin/gcc-mp-6 -pipe -Os -m32 ' works. |
---|
2 | Try: /opt/local/bin/gcc-mp-6 |
---|
3 | Line: /opt/local/bin/gcc-mp-6 -pipe -Os -m32 cmake_bootstrap_1843_test.c -o cmake_bootstrap_1843_test |
---|
4 | ---------- file ----------------------- |
---|
5 | |
---|
6 | #ifdef __cplusplus |
---|
7 | # error "The CMAKE_C_COMPILER is set to a C++ compiler" |
---|
8 | #endif |
---|
9 | |
---|
10 | #if defined(__sun) && __STDC_VERSION__ < 199901L |
---|
11 | #error "On Solaris we need C99." |
---|
12 | #endif |
---|
13 | |
---|
14 | #include <stdio.h> |
---|
15 | |
---|
16 | int main(int argc, char* argv[]) |
---|
17 | { |
---|
18 | printf("%d%c", (argv != 0), (char)0x0a); |
---|
19 | return argc - 1; |
---|
20 | } |
---|
21 | |
---|
22 | ------------------------------------------ |
---|
23 | 1 |
---|
24 | Test succeeded |
---|
25 | Checking whether '/opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 ' works. |
---|
26 | Try: /opt/local/bin/g++-mp-6 |
---|
27 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 cmake_bootstrap_1843_test.cxx -o cmake_bootstrap_1843_test |
---|
28 | ---------- file ----------------------- |
---|
29 | |
---|
30 | #include <iostream> |
---|
31 | #include <memory> |
---|
32 | |
---|
33 | #if __cplusplus < 201103L |
---|
34 | #error "Compiler is not in a mode aware of C++11." |
---|
35 | #endif |
---|
36 | |
---|
37 | #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140 |
---|
38 | #error "SunPro <= 5.13 mode not supported due to bug in move semantics." |
---|
39 | #endif |
---|
40 | |
---|
41 | class Class |
---|
42 | { |
---|
43 | public: |
---|
44 | int Get() const { return this->Member; } |
---|
45 | private: |
---|
46 | int Member = 1; |
---|
47 | }; |
---|
48 | int main() |
---|
49 | { |
---|
50 | auto const c = std::unique_ptr<Class>(new Class); |
---|
51 | std::cout << c->Get() << std::endl; |
---|
52 | return 0; |
---|
53 | } |
---|
54 | |
---|
55 | ------------------------------------------ |
---|
56 | ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o |
---|
57 | 1 |
---|
58 | Test succeeded |
---|
59 | Try: gmake |
---|
60 | "/opt/local/bin/gcc-mp-6" -L/opt/local/lib -Wl,-headerpad_max_install_names -framework CoreFoundation -pipe -Os -m32 -o test test.c |
---|
61 | 1 |
---|
62 | gmake works |
---|
63 | Try: /opt/local/bin/g++-mp-6 |
---|
64 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -DTEST_KWSYS_CXX_HAS_SETENV /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_1843_test |
---|
65 | ---------- file ----------------------- |
---|
66 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
---|
67 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
---|
68 | #ifdef TEST_KWSYS_CXX_HAS_CSTDIO |
---|
69 | #include <cstdio> |
---|
70 | int main() |
---|
71 | { |
---|
72 | return 0; |
---|
73 | } |
---|
74 | #endif |
---|
75 | |
---|
76 | #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG |
---|
77 | long long f(long long n) |
---|
78 | { |
---|
79 | return n; |
---|
80 | } |
---|
81 | int main() |
---|
82 | { |
---|
83 | long long n = 0; |
---|
84 | return static_cast<int>(f(n)); |
---|
85 | } |
---|
86 | #endif |
---|
87 | |
---|
88 | #ifdef TEST_KWSYS_CXX_HAS___INT64 |
---|
89 | __int64 f(__int64 n) |
---|
90 | { |
---|
91 | return n; |
---|
92 | } |
---|
93 | int main() |
---|
94 | { |
---|
95 | __int64 n = 0; |
---|
96 | return static_cast<int>(f(n)); |
---|
97 | } |
---|
98 | #endif |
---|
99 | |
---|
100 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
---|
101 | #include <sys/types.h> |
---|
102 | |
---|
103 | #include <sys/stat.h> |
---|
104 | #include <unistd.h> |
---|
105 | int main() |
---|
106 | { |
---|
107 | struct stat stat1; |
---|
108 | (void)stat1.st_mtim.tv_sec; |
---|
109 | (void)stat1.st_mtim.tv_nsec; |
---|
110 | return 0; |
---|
111 | } |
---|
112 | #endif |
---|
113 | |
---|
114 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
---|
115 | #include <sys/types.h> |
---|
116 | |
---|
117 | #include <sys/stat.h> |
---|
118 | #include <unistd.h> |
---|
119 | int main() |
---|
120 | { |
---|
121 | struct stat stat1; |
---|
122 | (void)stat1.st_mtimespec.tv_sec; |
---|
123 | (void)stat1.st_mtimespec.tv_nsec; |
---|
124 | return 0; |
---|
125 | } |
---|
126 | #endif |
---|
127 | |
---|
128 | #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 |
---|
129 | void function(long**) |
---|
130 | { |
---|
131 | } |
---|
132 | int main() |
---|
133 | { |
---|
134 | __int64** p = 0; |
---|
135 | function(p); |
---|
136 | return 0; |
---|
137 | } |
---|
138 | #endif |
---|
139 | |
---|
140 | #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 |
---|
141 | void function(long long**) |
---|
142 | { |
---|
143 | } |
---|
144 | int main() |
---|
145 | { |
---|
146 | __int64** p = 0; |
---|
147 | function(p); |
---|
148 | return 0; |
---|
149 | } |
---|
150 | #endif |
---|
151 | |
---|
152 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG |
---|
153 | #include <iostream> |
---|
154 | int test_istream(std::istream& is, long long& x) |
---|
155 | { |
---|
156 | return (is >> x) ? 1 : 0; |
---|
157 | } |
---|
158 | int main() |
---|
159 | { |
---|
160 | long long x = 0; |
---|
161 | return test_istream(std::cin, x); |
---|
162 | } |
---|
163 | #endif |
---|
164 | |
---|
165 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG |
---|
166 | #include <iostream> |
---|
167 | int test_ostream(std::ostream& os, long long x) |
---|
168 | { |
---|
169 | return (os << x) ? 1 : 0; |
---|
170 | } |
---|
171 | int main() |
---|
172 | { |
---|
173 | long long x = 0; |
---|
174 | return test_ostream(std::cout, x); |
---|
175 | } |
---|
176 | #endif |
---|
177 | |
---|
178 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 |
---|
179 | #include <iostream> |
---|
180 | int test_istream(std::istream& is, __int64& x) |
---|
181 | { |
---|
182 | return (is >> x) ? 1 : 0; |
---|
183 | } |
---|
184 | int main() |
---|
185 | { |
---|
186 | __int64 x = 0; |
---|
187 | return test_istream(std::cin, x); |
---|
188 | } |
---|
189 | #endif |
---|
190 | |
---|
191 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 |
---|
192 | #include <iostream> |
---|
193 | int test_ostream(std::ostream& os, __int64 x) |
---|
194 | { |
---|
195 | return (os << x) ? 1 : 0; |
---|
196 | } |
---|
197 | int main() |
---|
198 | { |
---|
199 | __int64 x = 0; |
---|
200 | return test_ostream(std::cout, x); |
---|
201 | } |
---|
202 | #endif |
---|
203 | |
---|
204 | #ifdef TEST_KWSYS_LFS_WORKS |
---|
205 | /* Return 0 when LFS is available and 1 otherwise. */ |
---|
206 | #define _LARGEFILE_SOURCE |
---|
207 | #define _LARGEFILE64_SOURCE |
---|
208 | #define _LARGE_FILES |
---|
209 | #define _FILE_OFFSET_BITS 64 |
---|
210 | #include <sys/types.h> |
---|
211 | |
---|
212 | #include <assert.h> |
---|
213 | #include <sys/stat.h> |
---|
214 | #if KWSYS_CXX_HAS_CSTDIO |
---|
215 | #include <cstdio> |
---|
216 | #endif |
---|
217 | #include <stdio.h> |
---|
218 | |
---|
219 | int main(int, char** argv) |
---|
220 | { |
---|
221 | /* check that off_t can hold 2^63 - 1 and perform basic operations... */ |
---|
222 | #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) |
---|
223 | if (OFF_T_64 % 2147483647 != 1) |
---|
224 | return 1; |
---|
225 | |
---|
226 | // stat breaks on SCO OpenServer |
---|
227 | struct stat buf; |
---|
228 | stat(argv[0], &buf); |
---|
229 | if (!S_ISREG(buf.st_mode)) |
---|
230 | return 2; |
---|
231 | |
---|
232 | FILE* file = fopen(argv[0], "r"); |
---|
233 | off_t offset = ftello(file); |
---|
234 | fseek(file, offset, SEEK_CUR); |
---|
235 | fclose(file); |
---|
236 | return 0; |
---|
237 | } |
---|
238 | #endif |
---|
239 | |
---|
240 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
---|
241 | #include <stdlib.h> |
---|
242 | int main() |
---|
243 | { |
---|
244 | return setenv("A", "B", 1); |
---|
245 | } |
---|
246 | #endif |
---|
247 | |
---|
248 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
---|
249 | #include <stdlib.h> |
---|
250 | int main() |
---|
251 | { |
---|
252 | unsetenv("A"); |
---|
253 | return 0; |
---|
254 | } |
---|
255 | #endif |
---|
256 | |
---|
257 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
---|
258 | #include <stdlib.h> |
---|
259 | int main() |
---|
260 | { |
---|
261 | char* e = environ[0]; |
---|
262 | return e ? 0 : 1; |
---|
263 | } |
---|
264 | #endif |
---|
265 | |
---|
266 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
---|
267 | // Match feature definitions from SystemInformation.cxx |
---|
268 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
269 | #define _GNU_SOURCE |
---|
270 | #endif |
---|
271 | #include <stdlib.h> |
---|
272 | int main() |
---|
273 | { |
---|
274 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
---|
275 | return getloadavg(loadavg, 3); |
---|
276 | } |
---|
277 | #endif |
---|
278 | |
---|
279 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
---|
280 | #if defined(KWSYS_HAS_LFS) |
---|
281 | #define _LARGEFILE_SOURCE |
---|
282 | #define _LARGEFILE64_SOURCE |
---|
283 | #define _LARGE_FILES |
---|
284 | #define _FILE_OFFSET_BITS 64 |
---|
285 | #endif |
---|
286 | #include <sys/resource.h> |
---|
287 | int main() |
---|
288 | { |
---|
289 | struct rlimit64 rlim; |
---|
290 | return getrlimit64(0, &rlim); |
---|
291 | } |
---|
292 | #endif |
---|
293 | |
---|
294 | #ifdef TEST_KWSYS_CXX_HAS_ATOLL |
---|
295 | #include <stdlib.h> |
---|
296 | int main() |
---|
297 | { |
---|
298 | const char* str = "1024"; |
---|
299 | return static_cast<int>(atoll(str)); |
---|
300 | } |
---|
301 | #endif |
---|
302 | |
---|
303 | #ifdef TEST_KWSYS_CXX_HAS_ATOL |
---|
304 | #include <stdlib.h> |
---|
305 | int main() |
---|
306 | { |
---|
307 | const char* str = "1024"; |
---|
308 | return static_cast<int>(atol(str)); |
---|
309 | } |
---|
310 | #endif |
---|
311 | |
---|
312 | #ifdef TEST_KWSYS_CXX_HAS__ATOI64 |
---|
313 | #include <stdlib.h> |
---|
314 | int main() |
---|
315 | { |
---|
316 | const char* str = "1024"; |
---|
317 | return static_cast<int>(_atoi64(str)); |
---|
318 | } |
---|
319 | #endif |
---|
320 | |
---|
321 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
---|
322 | #include <sys/time.h> |
---|
323 | int main() |
---|
324 | { |
---|
325 | struct timeval* current_time = 0; |
---|
326 | return utimes("/example", current_time); |
---|
327 | } |
---|
328 | #endif |
---|
329 | |
---|
330 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
---|
331 | #include <fcntl.h> |
---|
332 | #include <sys/stat.h> |
---|
333 | #if defined(__APPLE__) |
---|
334 | #include <AvailabilityMacros.h> |
---|
335 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
---|
336 | #error "utimensat not available on macOS < 10.13" |
---|
337 | #endif |
---|
338 | #endif |
---|
339 | int main() |
---|
340 | { |
---|
341 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
---|
342 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
---|
343 | } |
---|
344 | #endif |
---|
345 | |
---|
346 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
---|
347 | #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
---|
348 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
---|
349 | backtrace doesnt work with this compiler or os |
---|
350 | #endif |
---|
351 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
352 | #define _GNU_SOURCE |
---|
353 | #endif |
---|
354 | #include <execinfo.h> |
---|
355 | int main() |
---|
356 | { |
---|
357 | void* stackSymbols[256]; |
---|
358 | backtrace(stackSymbols, 256); |
---|
359 | backtrace_symbols(&stackSymbols[0], 1); |
---|
360 | return 0; |
---|
361 | } |
---|
362 | #endif |
---|
363 | |
---|
364 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
---|
365 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
366 | #define _GNU_SOURCE |
---|
367 | #endif |
---|
368 | #include <dlfcn.h> |
---|
369 | int main() |
---|
370 | { |
---|
371 | Dl_info info; |
---|
372 | int ierr = dladdr((void*)main, &info); |
---|
373 | return 0; |
---|
374 | } |
---|
375 | #endif |
---|
376 | |
---|
377 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
---|
378 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
379 | #define _GNU_SOURCE |
---|
380 | #endif |
---|
381 | #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
---|
382 | __SUNPRO_CC_COMPAT == 'G' |
---|
383 | #include <iostream> |
---|
384 | #endif |
---|
385 | #include <cxxabi.h> |
---|
386 | int main() |
---|
387 | { |
---|
388 | int status = 0; |
---|
389 | size_t bufferLen = 512; |
---|
390 | char buffer[512] = { '\0' }; |
---|
391 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
---|
392 | char* demangledFunction = |
---|
393 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
---|
394 | return status; |
---|
395 | } |
---|
396 | #endif |
---|
397 | |
---|
398 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM |
---|
399 | int main() |
---|
400 | { |
---|
401 | int a = 1; |
---|
402 | __asm { |
---|
403 | xor EBX, EBX; |
---|
404 | mov a, EBX; |
---|
405 | } |
---|
406 | |
---|
407 | return a; |
---|
408 | } |
---|
409 | #endif |
---|
410 | |
---|
411 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID |
---|
412 | int main() |
---|
413 | { |
---|
414 | int a = 0; |
---|
415 | __asm { |
---|
416 | xor EAX, EAX; |
---|
417 | cpuid; |
---|
418 | mov a, EAX; |
---|
419 | } |
---|
420 | |
---|
421 | return a; |
---|
422 | } |
---|
423 | #endif |
---|
424 | |
---|
425 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
---|
426 | #include <string> |
---|
427 | void f(std::wstring*) |
---|
428 | { |
---|
429 | } |
---|
430 | int main() |
---|
431 | { |
---|
432 | return 0; |
---|
433 | } |
---|
434 | #endif |
---|
435 | |
---|
436 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
---|
437 | #include <ext/stdio_filebuf.h> |
---|
438 | int main() |
---|
439 | { |
---|
440 | return 0; |
---|
441 | } |
---|
442 | #endif |
---|
443 | ------------------------------------------ |
---|
444 | ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o |
---|
445 | Test succeeded |
---|
446 | Try: /opt/local/bin/g++-mp-6 |
---|
447 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -DTEST_KWSYS_CXX_HAS_UNSETENV /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_1843_test |
---|
448 | ---------- file ----------------------- |
---|
449 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
---|
450 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
---|
451 | #ifdef TEST_KWSYS_CXX_HAS_CSTDIO |
---|
452 | #include <cstdio> |
---|
453 | int main() |
---|
454 | { |
---|
455 | return 0; |
---|
456 | } |
---|
457 | #endif |
---|
458 | |
---|
459 | #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG |
---|
460 | long long f(long long n) |
---|
461 | { |
---|
462 | return n; |
---|
463 | } |
---|
464 | int main() |
---|
465 | { |
---|
466 | long long n = 0; |
---|
467 | return static_cast<int>(f(n)); |
---|
468 | } |
---|
469 | #endif |
---|
470 | |
---|
471 | #ifdef TEST_KWSYS_CXX_HAS___INT64 |
---|
472 | __int64 f(__int64 n) |
---|
473 | { |
---|
474 | return n; |
---|
475 | } |
---|
476 | int main() |
---|
477 | { |
---|
478 | __int64 n = 0; |
---|
479 | return static_cast<int>(f(n)); |
---|
480 | } |
---|
481 | #endif |
---|
482 | |
---|
483 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
---|
484 | #include <sys/types.h> |
---|
485 | |
---|
486 | #include <sys/stat.h> |
---|
487 | #include <unistd.h> |
---|
488 | int main() |
---|
489 | { |
---|
490 | struct stat stat1; |
---|
491 | (void)stat1.st_mtim.tv_sec; |
---|
492 | (void)stat1.st_mtim.tv_nsec; |
---|
493 | return 0; |
---|
494 | } |
---|
495 | #endif |
---|
496 | |
---|
497 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
---|
498 | #include <sys/types.h> |
---|
499 | |
---|
500 | #include <sys/stat.h> |
---|
501 | #include <unistd.h> |
---|
502 | int main() |
---|
503 | { |
---|
504 | struct stat stat1; |
---|
505 | (void)stat1.st_mtimespec.tv_sec; |
---|
506 | (void)stat1.st_mtimespec.tv_nsec; |
---|
507 | return 0; |
---|
508 | } |
---|
509 | #endif |
---|
510 | |
---|
511 | #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 |
---|
512 | void function(long**) |
---|
513 | { |
---|
514 | } |
---|
515 | int main() |
---|
516 | { |
---|
517 | __int64** p = 0; |
---|
518 | function(p); |
---|
519 | return 0; |
---|
520 | } |
---|
521 | #endif |
---|
522 | |
---|
523 | #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 |
---|
524 | void function(long long**) |
---|
525 | { |
---|
526 | } |
---|
527 | int main() |
---|
528 | { |
---|
529 | __int64** p = 0; |
---|
530 | function(p); |
---|
531 | return 0; |
---|
532 | } |
---|
533 | #endif |
---|
534 | |
---|
535 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG |
---|
536 | #include <iostream> |
---|
537 | int test_istream(std::istream& is, long long& x) |
---|
538 | { |
---|
539 | return (is >> x) ? 1 : 0; |
---|
540 | } |
---|
541 | int main() |
---|
542 | { |
---|
543 | long long x = 0; |
---|
544 | return test_istream(std::cin, x); |
---|
545 | } |
---|
546 | #endif |
---|
547 | |
---|
548 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG |
---|
549 | #include <iostream> |
---|
550 | int test_ostream(std::ostream& os, long long x) |
---|
551 | { |
---|
552 | return (os << x) ? 1 : 0; |
---|
553 | } |
---|
554 | int main() |
---|
555 | { |
---|
556 | long long x = 0; |
---|
557 | return test_ostream(std::cout, x); |
---|
558 | } |
---|
559 | #endif |
---|
560 | |
---|
561 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 |
---|
562 | #include <iostream> |
---|
563 | int test_istream(std::istream& is, __int64& x) |
---|
564 | { |
---|
565 | return (is >> x) ? 1 : 0; |
---|
566 | } |
---|
567 | int main() |
---|
568 | { |
---|
569 | __int64 x = 0; |
---|
570 | return test_istream(std::cin, x); |
---|
571 | } |
---|
572 | #endif |
---|
573 | |
---|
574 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 |
---|
575 | #include <iostream> |
---|
576 | int test_ostream(std::ostream& os, __int64 x) |
---|
577 | { |
---|
578 | return (os << x) ? 1 : 0; |
---|
579 | } |
---|
580 | int main() |
---|
581 | { |
---|
582 | __int64 x = 0; |
---|
583 | return test_ostream(std::cout, x); |
---|
584 | } |
---|
585 | #endif |
---|
586 | |
---|
587 | #ifdef TEST_KWSYS_LFS_WORKS |
---|
588 | /* Return 0 when LFS is available and 1 otherwise. */ |
---|
589 | #define _LARGEFILE_SOURCE |
---|
590 | #define _LARGEFILE64_SOURCE |
---|
591 | #define _LARGE_FILES |
---|
592 | #define _FILE_OFFSET_BITS 64 |
---|
593 | #include <sys/types.h> |
---|
594 | |
---|
595 | #include <assert.h> |
---|
596 | #include <sys/stat.h> |
---|
597 | #if KWSYS_CXX_HAS_CSTDIO |
---|
598 | #include <cstdio> |
---|
599 | #endif |
---|
600 | #include <stdio.h> |
---|
601 | |
---|
602 | int main(int, char** argv) |
---|
603 | { |
---|
604 | /* check that off_t can hold 2^63 - 1 and perform basic operations... */ |
---|
605 | #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) |
---|
606 | if (OFF_T_64 % 2147483647 != 1) |
---|
607 | return 1; |
---|
608 | |
---|
609 | // stat breaks on SCO OpenServer |
---|
610 | struct stat buf; |
---|
611 | stat(argv[0], &buf); |
---|
612 | if (!S_ISREG(buf.st_mode)) |
---|
613 | return 2; |
---|
614 | |
---|
615 | FILE* file = fopen(argv[0], "r"); |
---|
616 | off_t offset = ftello(file); |
---|
617 | fseek(file, offset, SEEK_CUR); |
---|
618 | fclose(file); |
---|
619 | return 0; |
---|
620 | } |
---|
621 | #endif |
---|
622 | |
---|
623 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
---|
624 | #include <stdlib.h> |
---|
625 | int main() |
---|
626 | { |
---|
627 | return setenv("A", "B", 1); |
---|
628 | } |
---|
629 | #endif |
---|
630 | |
---|
631 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
---|
632 | #include <stdlib.h> |
---|
633 | int main() |
---|
634 | { |
---|
635 | unsetenv("A"); |
---|
636 | return 0; |
---|
637 | } |
---|
638 | #endif |
---|
639 | |
---|
640 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
---|
641 | #include <stdlib.h> |
---|
642 | int main() |
---|
643 | { |
---|
644 | char* e = environ[0]; |
---|
645 | return e ? 0 : 1; |
---|
646 | } |
---|
647 | #endif |
---|
648 | |
---|
649 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
---|
650 | // Match feature definitions from SystemInformation.cxx |
---|
651 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
652 | #define _GNU_SOURCE |
---|
653 | #endif |
---|
654 | #include <stdlib.h> |
---|
655 | int main() |
---|
656 | { |
---|
657 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
---|
658 | return getloadavg(loadavg, 3); |
---|
659 | } |
---|
660 | #endif |
---|
661 | |
---|
662 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
---|
663 | #if defined(KWSYS_HAS_LFS) |
---|
664 | #define _LARGEFILE_SOURCE |
---|
665 | #define _LARGEFILE64_SOURCE |
---|
666 | #define _LARGE_FILES |
---|
667 | #define _FILE_OFFSET_BITS 64 |
---|
668 | #endif |
---|
669 | #include <sys/resource.h> |
---|
670 | int main() |
---|
671 | { |
---|
672 | struct rlimit64 rlim; |
---|
673 | return getrlimit64(0, &rlim); |
---|
674 | } |
---|
675 | #endif |
---|
676 | |
---|
677 | #ifdef TEST_KWSYS_CXX_HAS_ATOLL |
---|
678 | #include <stdlib.h> |
---|
679 | int main() |
---|
680 | { |
---|
681 | const char* str = "1024"; |
---|
682 | return static_cast<int>(atoll(str)); |
---|
683 | } |
---|
684 | #endif |
---|
685 | |
---|
686 | #ifdef TEST_KWSYS_CXX_HAS_ATOL |
---|
687 | #include <stdlib.h> |
---|
688 | int main() |
---|
689 | { |
---|
690 | const char* str = "1024"; |
---|
691 | return static_cast<int>(atol(str)); |
---|
692 | } |
---|
693 | #endif |
---|
694 | |
---|
695 | #ifdef TEST_KWSYS_CXX_HAS__ATOI64 |
---|
696 | #include <stdlib.h> |
---|
697 | int main() |
---|
698 | { |
---|
699 | const char* str = "1024"; |
---|
700 | return static_cast<int>(_atoi64(str)); |
---|
701 | } |
---|
702 | #endif |
---|
703 | |
---|
704 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
---|
705 | #include <sys/time.h> |
---|
706 | int main() |
---|
707 | { |
---|
708 | struct timeval* current_time = 0; |
---|
709 | return utimes("/example", current_time); |
---|
710 | } |
---|
711 | #endif |
---|
712 | |
---|
713 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
---|
714 | #include <fcntl.h> |
---|
715 | #include <sys/stat.h> |
---|
716 | #if defined(__APPLE__) |
---|
717 | #include <AvailabilityMacros.h> |
---|
718 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
---|
719 | #error "utimensat not available on macOS < 10.13" |
---|
720 | #endif |
---|
721 | #endif |
---|
722 | int main() |
---|
723 | { |
---|
724 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
---|
725 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
---|
726 | } |
---|
727 | #endif |
---|
728 | |
---|
729 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
---|
730 | #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
---|
731 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
---|
732 | backtrace doesnt work with this compiler or os |
---|
733 | #endif |
---|
734 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
735 | #define _GNU_SOURCE |
---|
736 | #endif |
---|
737 | #include <execinfo.h> |
---|
738 | int main() |
---|
739 | { |
---|
740 | void* stackSymbols[256]; |
---|
741 | backtrace(stackSymbols, 256); |
---|
742 | backtrace_symbols(&stackSymbols[0], 1); |
---|
743 | return 0; |
---|
744 | } |
---|
745 | #endif |
---|
746 | |
---|
747 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
---|
748 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
749 | #define _GNU_SOURCE |
---|
750 | #endif |
---|
751 | #include <dlfcn.h> |
---|
752 | int main() |
---|
753 | { |
---|
754 | Dl_info info; |
---|
755 | int ierr = dladdr((void*)main, &info); |
---|
756 | return 0; |
---|
757 | } |
---|
758 | #endif |
---|
759 | |
---|
760 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
---|
761 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
762 | #define _GNU_SOURCE |
---|
763 | #endif |
---|
764 | #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
---|
765 | __SUNPRO_CC_COMPAT == 'G' |
---|
766 | #include <iostream> |
---|
767 | #endif |
---|
768 | #include <cxxabi.h> |
---|
769 | int main() |
---|
770 | { |
---|
771 | int status = 0; |
---|
772 | size_t bufferLen = 512; |
---|
773 | char buffer[512] = { '\0' }; |
---|
774 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
---|
775 | char* demangledFunction = |
---|
776 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
---|
777 | return status; |
---|
778 | } |
---|
779 | #endif |
---|
780 | |
---|
781 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM |
---|
782 | int main() |
---|
783 | { |
---|
784 | int a = 1; |
---|
785 | __asm { |
---|
786 | xor EBX, EBX; |
---|
787 | mov a, EBX; |
---|
788 | } |
---|
789 | |
---|
790 | return a; |
---|
791 | } |
---|
792 | #endif |
---|
793 | |
---|
794 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID |
---|
795 | int main() |
---|
796 | { |
---|
797 | int a = 0; |
---|
798 | __asm { |
---|
799 | xor EAX, EAX; |
---|
800 | cpuid; |
---|
801 | mov a, EAX; |
---|
802 | } |
---|
803 | |
---|
804 | return a; |
---|
805 | } |
---|
806 | #endif |
---|
807 | |
---|
808 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
---|
809 | #include <string> |
---|
810 | void f(std::wstring*) |
---|
811 | { |
---|
812 | } |
---|
813 | int main() |
---|
814 | { |
---|
815 | return 0; |
---|
816 | } |
---|
817 | #endif |
---|
818 | |
---|
819 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
---|
820 | #include <ext/stdio_filebuf.h> |
---|
821 | int main() |
---|
822 | { |
---|
823 | return 0; |
---|
824 | } |
---|
825 | #endif |
---|
826 | ------------------------------------------ |
---|
827 | ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o |
---|
828 | Test succeeded |
---|
829 | Try: /opt/local/bin/g++-mp-6 |
---|
830 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_1843_test |
---|
831 | ---------- file ----------------------- |
---|
832 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
---|
833 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
---|
834 | #ifdef TEST_KWSYS_CXX_HAS_CSTDIO |
---|
835 | #include <cstdio> |
---|
836 | int main() |
---|
837 | { |
---|
838 | return 0; |
---|
839 | } |
---|
840 | #endif |
---|
841 | |
---|
842 | #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG |
---|
843 | long long f(long long n) |
---|
844 | { |
---|
845 | return n; |
---|
846 | } |
---|
847 | int main() |
---|
848 | { |
---|
849 | long long n = 0; |
---|
850 | return static_cast<int>(f(n)); |
---|
851 | } |
---|
852 | #endif |
---|
853 | |
---|
854 | #ifdef TEST_KWSYS_CXX_HAS___INT64 |
---|
855 | __int64 f(__int64 n) |
---|
856 | { |
---|
857 | return n; |
---|
858 | } |
---|
859 | int main() |
---|
860 | { |
---|
861 | __int64 n = 0; |
---|
862 | return static_cast<int>(f(n)); |
---|
863 | } |
---|
864 | #endif |
---|
865 | |
---|
866 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
---|
867 | #include <sys/types.h> |
---|
868 | |
---|
869 | #include <sys/stat.h> |
---|
870 | #include <unistd.h> |
---|
871 | int main() |
---|
872 | { |
---|
873 | struct stat stat1; |
---|
874 | (void)stat1.st_mtim.tv_sec; |
---|
875 | (void)stat1.st_mtim.tv_nsec; |
---|
876 | return 0; |
---|
877 | } |
---|
878 | #endif |
---|
879 | |
---|
880 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
---|
881 | #include <sys/types.h> |
---|
882 | |
---|
883 | #include <sys/stat.h> |
---|
884 | #include <unistd.h> |
---|
885 | int main() |
---|
886 | { |
---|
887 | struct stat stat1; |
---|
888 | (void)stat1.st_mtimespec.tv_sec; |
---|
889 | (void)stat1.st_mtimespec.tv_nsec; |
---|
890 | return 0; |
---|
891 | } |
---|
892 | #endif |
---|
893 | |
---|
894 | #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 |
---|
895 | void function(long**) |
---|
896 | { |
---|
897 | } |
---|
898 | int main() |
---|
899 | { |
---|
900 | __int64** p = 0; |
---|
901 | function(p); |
---|
902 | return 0; |
---|
903 | } |
---|
904 | #endif |
---|
905 | |
---|
906 | #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 |
---|
907 | void function(long long**) |
---|
908 | { |
---|
909 | } |
---|
910 | int main() |
---|
911 | { |
---|
912 | __int64** p = 0; |
---|
913 | function(p); |
---|
914 | return 0; |
---|
915 | } |
---|
916 | #endif |
---|
917 | |
---|
918 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG |
---|
919 | #include <iostream> |
---|
920 | int test_istream(std::istream& is, long long& x) |
---|
921 | { |
---|
922 | return (is >> x) ? 1 : 0; |
---|
923 | } |
---|
924 | int main() |
---|
925 | { |
---|
926 | long long x = 0; |
---|
927 | return test_istream(std::cin, x); |
---|
928 | } |
---|
929 | #endif |
---|
930 | |
---|
931 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG |
---|
932 | #include <iostream> |
---|
933 | int test_ostream(std::ostream& os, long long x) |
---|
934 | { |
---|
935 | return (os << x) ? 1 : 0; |
---|
936 | } |
---|
937 | int main() |
---|
938 | { |
---|
939 | long long x = 0; |
---|
940 | return test_ostream(std::cout, x); |
---|
941 | } |
---|
942 | #endif |
---|
943 | |
---|
944 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 |
---|
945 | #include <iostream> |
---|
946 | int test_istream(std::istream& is, __int64& x) |
---|
947 | { |
---|
948 | return (is >> x) ? 1 : 0; |
---|
949 | } |
---|
950 | int main() |
---|
951 | { |
---|
952 | __int64 x = 0; |
---|
953 | return test_istream(std::cin, x); |
---|
954 | } |
---|
955 | #endif |
---|
956 | |
---|
957 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 |
---|
958 | #include <iostream> |
---|
959 | int test_ostream(std::ostream& os, __int64 x) |
---|
960 | { |
---|
961 | return (os << x) ? 1 : 0; |
---|
962 | } |
---|
963 | int main() |
---|
964 | { |
---|
965 | __int64 x = 0; |
---|
966 | return test_ostream(std::cout, x); |
---|
967 | } |
---|
968 | #endif |
---|
969 | |
---|
970 | #ifdef TEST_KWSYS_LFS_WORKS |
---|
971 | /* Return 0 when LFS is available and 1 otherwise. */ |
---|
972 | #define _LARGEFILE_SOURCE |
---|
973 | #define _LARGEFILE64_SOURCE |
---|
974 | #define _LARGE_FILES |
---|
975 | #define _FILE_OFFSET_BITS 64 |
---|
976 | #include <sys/types.h> |
---|
977 | |
---|
978 | #include <assert.h> |
---|
979 | #include <sys/stat.h> |
---|
980 | #if KWSYS_CXX_HAS_CSTDIO |
---|
981 | #include <cstdio> |
---|
982 | #endif |
---|
983 | #include <stdio.h> |
---|
984 | |
---|
985 | int main(int, char** argv) |
---|
986 | { |
---|
987 | /* check that off_t can hold 2^63 - 1 and perform basic operations... */ |
---|
988 | #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) |
---|
989 | if (OFF_T_64 % 2147483647 != 1) |
---|
990 | return 1; |
---|
991 | |
---|
992 | // stat breaks on SCO OpenServer |
---|
993 | struct stat buf; |
---|
994 | stat(argv[0], &buf); |
---|
995 | if (!S_ISREG(buf.st_mode)) |
---|
996 | return 2; |
---|
997 | |
---|
998 | FILE* file = fopen(argv[0], "r"); |
---|
999 | off_t offset = ftello(file); |
---|
1000 | fseek(file, offset, SEEK_CUR); |
---|
1001 | fclose(file); |
---|
1002 | return 0; |
---|
1003 | } |
---|
1004 | #endif |
---|
1005 | |
---|
1006 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
---|
1007 | #include <stdlib.h> |
---|
1008 | int main() |
---|
1009 | { |
---|
1010 | return setenv("A", "B", 1); |
---|
1011 | } |
---|
1012 | #endif |
---|
1013 | |
---|
1014 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
---|
1015 | #include <stdlib.h> |
---|
1016 | int main() |
---|
1017 | { |
---|
1018 | unsetenv("A"); |
---|
1019 | return 0; |
---|
1020 | } |
---|
1021 | #endif |
---|
1022 | |
---|
1023 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
---|
1024 | #include <stdlib.h> |
---|
1025 | int main() |
---|
1026 | { |
---|
1027 | char* e = environ[0]; |
---|
1028 | return e ? 0 : 1; |
---|
1029 | } |
---|
1030 | #endif |
---|
1031 | |
---|
1032 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
---|
1033 | // Match feature definitions from SystemInformation.cxx |
---|
1034 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1035 | #define _GNU_SOURCE |
---|
1036 | #endif |
---|
1037 | #include <stdlib.h> |
---|
1038 | int main() |
---|
1039 | { |
---|
1040 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
---|
1041 | return getloadavg(loadavg, 3); |
---|
1042 | } |
---|
1043 | #endif |
---|
1044 | |
---|
1045 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
---|
1046 | #if defined(KWSYS_HAS_LFS) |
---|
1047 | #define _LARGEFILE_SOURCE |
---|
1048 | #define _LARGEFILE64_SOURCE |
---|
1049 | #define _LARGE_FILES |
---|
1050 | #define _FILE_OFFSET_BITS 64 |
---|
1051 | #endif |
---|
1052 | #include <sys/resource.h> |
---|
1053 | int main() |
---|
1054 | { |
---|
1055 | struct rlimit64 rlim; |
---|
1056 | return getrlimit64(0, &rlim); |
---|
1057 | } |
---|
1058 | #endif |
---|
1059 | |
---|
1060 | #ifdef TEST_KWSYS_CXX_HAS_ATOLL |
---|
1061 | #include <stdlib.h> |
---|
1062 | int main() |
---|
1063 | { |
---|
1064 | const char* str = "1024"; |
---|
1065 | return static_cast<int>(atoll(str)); |
---|
1066 | } |
---|
1067 | #endif |
---|
1068 | |
---|
1069 | #ifdef TEST_KWSYS_CXX_HAS_ATOL |
---|
1070 | #include <stdlib.h> |
---|
1071 | int main() |
---|
1072 | { |
---|
1073 | const char* str = "1024"; |
---|
1074 | return static_cast<int>(atol(str)); |
---|
1075 | } |
---|
1076 | #endif |
---|
1077 | |
---|
1078 | #ifdef TEST_KWSYS_CXX_HAS__ATOI64 |
---|
1079 | #include <stdlib.h> |
---|
1080 | int main() |
---|
1081 | { |
---|
1082 | const char* str = "1024"; |
---|
1083 | return static_cast<int>(_atoi64(str)); |
---|
1084 | } |
---|
1085 | #endif |
---|
1086 | |
---|
1087 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
---|
1088 | #include <sys/time.h> |
---|
1089 | int main() |
---|
1090 | { |
---|
1091 | struct timeval* current_time = 0; |
---|
1092 | return utimes("/example", current_time); |
---|
1093 | } |
---|
1094 | #endif |
---|
1095 | |
---|
1096 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
---|
1097 | #include <fcntl.h> |
---|
1098 | #include <sys/stat.h> |
---|
1099 | #if defined(__APPLE__) |
---|
1100 | #include <AvailabilityMacros.h> |
---|
1101 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
---|
1102 | #error "utimensat not available on macOS < 10.13" |
---|
1103 | #endif |
---|
1104 | #endif |
---|
1105 | int main() |
---|
1106 | { |
---|
1107 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
---|
1108 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
---|
1109 | } |
---|
1110 | #endif |
---|
1111 | |
---|
1112 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
---|
1113 | #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
---|
1114 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
---|
1115 | backtrace doesnt work with this compiler or os |
---|
1116 | #endif |
---|
1117 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1118 | #define _GNU_SOURCE |
---|
1119 | #endif |
---|
1120 | #include <execinfo.h> |
---|
1121 | int main() |
---|
1122 | { |
---|
1123 | void* stackSymbols[256]; |
---|
1124 | backtrace(stackSymbols, 256); |
---|
1125 | backtrace_symbols(&stackSymbols[0], 1); |
---|
1126 | return 0; |
---|
1127 | } |
---|
1128 | #endif |
---|
1129 | |
---|
1130 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
---|
1131 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1132 | #define _GNU_SOURCE |
---|
1133 | #endif |
---|
1134 | #include <dlfcn.h> |
---|
1135 | int main() |
---|
1136 | { |
---|
1137 | Dl_info info; |
---|
1138 | int ierr = dladdr((void*)main, &info); |
---|
1139 | return 0; |
---|
1140 | } |
---|
1141 | #endif |
---|
1142 | |
---|
1143 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
---|
1144 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1145 | #define _GNU_SOURCE |
---|
1146 | #endif |
---|
1147 | #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
---|
1148 | __SUNPRO_CC_COMPAT == 'G' |
---|
1149 | #include <iostream> |
---|
1150 | #endif |
---|
1151 | #include <cxxabi.h> |
---|
1152 | int main() |
---|
1153 | { |
---|
1154 | int status = 0; |
---|
1155 | size_t bufferLen = 512; |
---|
1156 | char buffer[512] = { '\0' }; |
---|
1157 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
---|
1158 | char* demangledFunction = |
---|
1159 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
---|
1160 | return status; |
---|
1161 | } |
---|
1162 | #endif |
---|
1163 | |
---|
1164 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM |
---|
1165 | int main() |
---|
1166 | { |
---|
1167 | int a = 1; |
---|
1168 | __asm { |
---|
1169 | xor EBX, EBX; |
---|
1170 | mov a, EBX; |
---|
1171 | } |
---|
1172 | |
---|
1173 | return a; |
---|
1174 | } |
---|
1175 | #endif |
---|
1176 | |
---|
1177 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID |
---|
1178 | int main() |
---|
1179 | { |
---|
1180 | int a = 0; |
---|
1181 | __asm { |
---|
1182 | xor EAX, EAX; |
---|
1183 | cpuid; |
---|
1184 | mov a, EAX; |
---|
1185 | } |
---|
1186 | |
---|
1187 | return a; |
---|
1188 | } |
---|
1189 | #endif |
---|
1190 | |
---|
1191 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
---|
1192 | #include <string> |
---|
1193 | void f(std::wstring*) |
---|
1194 | { |
---|
1195 | } |
---|
1196 | int main() |
---|
1197 | { |
---|
1198 | return 0; |
---|
1199 | } |
---|
1200 | #endif |
---|
1201 | |
---|
1202 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
---|
1203 | #include <ext/stdio_filebuf.h> |
---|
1204 | int main() |
---|
1205 | { |
---|
1206 | return 0; |
---|
1207 | } |
---|
1208 | #endif |
---|
1209 | ------------------------------------------ |
---|
1210 | /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx: In function 'int main()': |
---|
1211 | /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:196:13: error: 'environ' was not declared in this scope |
---|
1212 | char* e = environ[0]; |
---|
1213 | ^~~~~~~ |
---|
1214 | Test failed to compile |
---|
1215 | Try: /opt/local/bin/g++-mp-6 |
---|
1216 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -DTEST_KWSYS_STL_HAS_WSTRING /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_1843_test |
---|
1217 | ---------- file ----------------------- |
---|
1218 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
---|
1219 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
---|
1220 | #ifdef TEST_KWSYS_CXX_HAS_CSTDIO |
---|
1221 | #include <cstdio> |
---|
1222 | int main() |
---|
1223 | { |
---|
1224 | return 0; |
---|
1225 | } |
---|
1226 | #endif |
---|
1227 | |
---|
1228 | #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG |
---|
1229 | long long f(long long n) |
---|
1230 | { |
---|
1231 | return n; |
---|
1232 | } |
---|
1233 | int main() |
---|
1234 | { |
---|
1235 | long long n = 0; |
---|
1236 | return static_cast<int>(f(n)); |
---|
1237 | } |
---|
1238 | #endif |
---|
1239 | |
---|
1240 | #ifdef TEST_KWSYS_CXX_HAS___INT64 |
---|
1241 | __int64 f(__int64 n) |
---|
1242 | { |
---|
1243 | return n; |
---|
1244 | } |
---|
1245 | int main() |
---|
1246 | { |
---|
1247 | __int64 n = 0; |
---|
1248 | return static_cast<int>(f(n)); |
---|
1249 | } |
---|
1250 | #endif |
---|
1251 | |
---|
1252 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
---|
1253 | #include <sys/types.h> |
---|
1254 | |
---|
1255 | #include <sys/stat.h> |
---|
1256 | #include <unistd.h> |
---|
1257 | int main() |
---|
1258 | { |
---|
1259 | struct stat stat1; |
---|
1260 | (void)stat1.st_mtim.tv_sec; |
---|
1261 | (void)stat1.st_mtim.tv_nsec; |
---|
1262 | return 0; |
---|
1263 | } |
---|
1264 | #endif |
---|
1265 | |
---|
1266 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
---|
1267 | #include <sys/types.h> |
---|
1268 | |
---|
1269 | #include <sys/stat.h> |
---|
1270 | #include <unistd.h> |
---|
1271 | int main() |
---|
1272 | { |
---|
1273 | struct stat stat1; |
---|
1274 | (void)stat1.st_mtimespec.tv_sec; |
---|
1275 | (void)stat1.st_mtimespec.tv_nsec; |
---|
1276 | return 0; |
---|
1277 | } |
---|
1278 | #endif |
---|
1279 | |
---|
1280 | #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 |
---|
1281 | void function(long**) |
---|
1282 | { |
---|
1283 | } |
---|
1284 | int main() |
---|
1285 | { |
---|
1286 | __int64** p = 0; |
---|
1287 | function(p); |
---|
1288 | return 0; |
---|
1289 | } |
---|
1290 | #endif |
---|
1291 | |
---|
1292 | #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 |
---|
1293 | void function(long long**) |
---|
1294 | { |
---|
1295 | } |
---|
1296 | int main() |
---|
1297 | { |
---|
1298 | __int64** p = 0; |
---|
1299 | function(p); |
---|
1300 | return 0; |
---|
1301 | } |
---|
1302 | #endif |
---|
1303 | |
---|
1304 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG |
---|
1305 | #include <iostream> |
---|
1306 | int test_istream(std::istream& is, long long& x) |
---|
1307 | { |
---|
1308 | return (is >> x) ? 1 : 0; |
---|
1309 | } |
---|
1310 | int main() |
---|
1311 | { |
---|
1312 | long long x = 0; |
---|
1313 | return test_istream(std::cin, x); |
---|
1314 | } |
---|
1315 | #endif |
---|
1316 | |
---|
1317 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG |
---|
1318 | #include <iostream> |
---|
1319 | int test_ostream(std::ostream& os, long long x) |
---|
1320 | { |
---|
1321 | return (os << x) ? 1 : 0; |
---|
1322 | } |
---|
1323 | int main() |
---|
1324 | { |
---|
1325 | long long x = 0; |
---|
1326 | return test_ostream(std::cout, x); |
---|
1327 | } |
---|
1328 | #endif |
---|
1329 | |
---|
1330 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 |
---|
1331 | #include <iostream> |
---|
1332 | int test_istream(std::istream& is, __int64& x) |
---|
1333 | { |
---|
1334 | return (is >> x) ? 1 : 0; |
---|
1335 | } |
---|
1336 | int main() |
---|
1337 | { |
---|
1338 | __int64 x = 0; |
---|
1339 | return test_istream(std::cin, x); |
---|
1340 | } |
---|
1341 | #endif |
---|
1342 | |
---|
1343 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 |
---|
1344 | #include <iostream> |
---|
1345 | int test_ostream(std::ostream& os, __int64 x) |
---|
1346 | { |
---|
1347 | return (os << x) ? 1 : 0; |
---|
1348 | } |
---|
1349 | int main() |
---|
1350 | { |
---|
1351 | __int64 x = 0; |
---|
1352 | return test_ostream(std::cout, x); |
---|
1353 | } |
---|
1354 | #endif |
---|
1355 | |
---|
1356 | #ifdef TEST_KWSYS_LFS_WORKS |
---|
1357 | /* Return 0 when LFS is available and 1 otherwise. */ |
---|
1358 | #define _LARGEFILE_SOURCE |
---|
1359 | #define _LARGEFILE64_SOURCE |
---|
1360 | #define _LARGE_FILES |
---|
1361 | #define _FILE_OFFSET_BITS 64 |
---|
1362 | #include <sys/types.h> |
---|
1363 | |
---|
1364 | #include <assert.h> |
---|
1365 | #include <sys/stat.h> |
---|
1366 | #if KWSYS_CXX_HAS_CSTDIO |
---|
1367 | #include <cstdio> |
---|
1368 | #endif |
---|
1369 | #include <stdio.h> |
---|
1370 | |
---|
1371 | int main(int, char** argv) |
---|
1372 | { |
---|
1373 | /* check that off_t can hold 2^63 - 1 and perform basic operations... */ |
---|
1374 | #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) |
---|
1375 | if (OFF_T_64 % 2147483647 != 1) |
---|
1376 | return 1; |
---|
1377 | |
---|
1378 | // stat breaks on SCO OpenServer |
---|
1379 | struct stat buf; |
---|
1380 | stat(argv[0], &buf); |
---|
1381 | if (!S_ISREG(buf.st_mode)) |
---|
1382 | return 2; |
---|
1383 | |
---|
1384 | FILE* file = fopen(argv[0], "r"); |
---|
1385 | off_t offset = ftello(file); |
---|
1386 | fseek(file, offset, SEEK_CUR); |
---|
1387 | fclose(file); |
---|
1388 | return 0; |
---|
1389 | } |
---|
1390 | #endif |
---|
1391 | |
---|
1392 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
---|
1393 | #include <stdlib.h> |
---|
1394 | int main() |
---|
1395 | { |
---|
1396 | return setenv("A", "B", 1); |
---|
1397 | } |
---|
1398 | #endif |
---|
1399 | |
---|
1400 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
---|
1401 | #include <stdlib.h> |
---|
1402 | int main() |
---|
1403 | { |
---|
1404 | unsetenv("A"); |
---|
1405 | return 0; |
---|
1406 | } |
---|
1407 | #endif |
---|
1408 | |
---|
1409 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
---|
1410 | #include <stdlib.h> |
---|
1411 | int main() |
---|
1412 | { |
---|
1413 | char* e = environ[0]; |
---|
1414 | return e ? 0 : 1; |
---|
1415 | } |
---|
1416 | #endif |
---|
1417 | |
---|
1418 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
---|
1419 | // Match feature definitions from SystemInformation.cxx |
---|
1420 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1421 | #define _GNU_SOURCE |
---|
1422 | #endif |
---|
1423 | #include <stdlib.h> |
---|
1424 | int main() |
---|
1425 | { |
---|
1426 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
---|
1427 | return getloadavg(loadavg, 3); |
---|
1428 | } |
---|
1429 | #endif |
---|
1430 | |
---|
1431 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
---|
1432 | #if defined(KWSYS_HAS_LFS) |
---|
1433 | #define _LARGEFILE_SOURCE |
---|
1434 | #define _LARGEFILE64_SOURCE |
---|
1435 | #define _LARGE_FILES |
---|
1436 | #define _FILE_OFFSET_BITS 64 |
---|
1437 | #endif |
---|
1438 | #include <sys/resource.h> |
---|
1439 | int main() |
---|
1440 | { |
---|
1441 | struct rlimit64 rlim; |
---|
1442 | return getrlimit64(0, &rlim); |
---|
1443 | } |
---|
1444 | #endif |
---|
1445 | |
---|
1446 | #ifdef TEST_KWSYS_CXX_HAS_ATOLL |
---|
1447 | #include <stdlib.h> |
---|
1448 | int main() |
---|
1449 | { |
---|
1450 | const char* str = "1024"; |
---|
1451 | return static_cast<int>(atoll(str)); |
---|
1452 | } |
---|
1453 | #endif |
---|
1454 | |
---|
1455 | #ifdef TEST_KWSYS_CXX_HAS_ATOL |
---|
1456 | #include <stdlib.h> |
---|
1457 | int main() |
---|
1458 | { |
---|
1459 | const char* str = "1024"; |
---|
1460 | return static_cast<int>(atol(str)); |
---|
1461 | } |
---|
1462 | #endif |
---|
1463 | |
---|
1464 | #ifdef TEST_KWSYS_CXX_HAS__ATOI64 |
---|
1465 | #include <stdlib.h> |
---|
1466 | int main() |
---|
1467 | { |
---|
1468 | const char* str = "1024"; |
---|
1469 | return static_cast<int>(_atoi64(str)); |
---|
1470 | } |
---|
1471 | #endif |
---|
1472 | |
---|
1473 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
---|
1474 | #include <sys/time.h> |
---|
1475 | int main() |
---|
1476 | { |
---|
1477 | struct timeval* current_time = 0; |
---|
1478 | return utimes("/example", current_time); |
---|
1479 | } |
---|
1480 | #endif |
---|
1481 | |
---|
1482 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
---|
1483 | #include <fcntl.h> |
---|
1484 | #include <sys/stat.h> |
---|
1485 | #if defined(__APPLE__) |
---|
1486 | #include <AvailabilityMacros.h> |
---|
1487 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
---|
1488 | #error "utimensat not available on macOS < 10.13" |
---|
1489 | #endif |
---|
1490 | #endif |
---|
1491 | int main() |
---|
1492 | { |
---|
1493 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
---|
1494 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
---|
1495 | } |
---|
1496 | #endif |
---|
1497 | |
---|
1498 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
---|
1499 | #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
---|
1500 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
---|
1501 | backtrace doesnt work with this compiler or os |
---|
1502 | #endif |
---|
1503 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1504 | #define _GNU_SOURCE |
---|
1505 | #endif |
---|
1506 | #include <execinfo.h> |
---|
1507 | int main() |
---|
1508 | { |
---|
1509 | void* stackSymbols[256]; |
---|
1510 | backtrace(stackSymbols, 256); |
---|
1511 | backtrace_symbols(&stackSymbols[0], 1); |
---|
1512 | return 0; |
---|
1513 | } |
---|
1514 | #endif |
---|
1515 | |
---|
1516 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
---|
1517 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1518 | #define _GNU_SOURCE |
---|
1519 | #endif |
---|
1520 | #include <dlfcn.h> |
---|
1521 | int main() |
---|
1522 | { |
---|
1523 | Dl_info info; |
---|
1524 | int ierr = dladdr((void*)main, &info); |
---|
1525 | return 0; |
---|
1526 | } |
---|
1527 | #endif |
---|
1528 | |
---|
1529 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
---|
1530 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1531 | #define _GNU_SOURCE |
---|
1532 | #endif |
---|
1533 | #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
---|
1534 | __SUNPRO_CC_COMPAT == 'G' |
---|
1535 | #include <iostream> |
---|
1536 | #endif |
---|
1537 | #include <cxxabi.h> |
---|
1538 | int main() |
---|
1539 | { |
---|
1540 | int status = 0; |
---|
1541 | size_t bufferLen = 512; |
---|
1542 | char buffer[512] = { '\0' }; |
---|
1543 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
---|
1544 | char* demangledFunction = |
---|
1545 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
---|
1546 | return status; |
---|
1547 | } |
---|
1548 | #endif |
---|
1549 | |
---|
1550 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM |
---|
1551 | int main() |
---|
1552 | { |
---|
1553 | int a = 1; |
---|
1554 | __asm { |
---|
1555 | xor EBX, EBX; |
---|
1556 | mov a, EBX; |
---|
1557 | } |
---|
1558 | |
---|
1559 | return a; |
---|
1560 | } |
---|
1561 | #endif |
---|
1562 | |
---|
1563 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID |
---|
1564 | int main() |
---|
1565 | { |
---|
1566 | int a = 0; |
---|
1567 | __asm { |
---|
1568 | xor EAX, EAX; |
---|
1569 | cpuid; |
---|
1570 | mov a, EAX; |
---|
1571 | } |
---|
1572 | |
---|
1573 | return a; |
---|
1574 | } |
---|
1575 | #endif |
---|
1576 | |
---|
1577 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
---|
1578 | #include <string> |
---|
1579 | void f(std::wstring*) |
---|
1580 | { |
---|
1581 | } |
---|
1582 | int main() |
---|
1583 | { |
---|
1584 | return 0; |
---|
1585 | } |
---|
1586 | #endif |
---|
1587 | |
---|
1588 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
---|
1589 | #include <ext/stdio_filebuf.h> |
---|
1590 | int main() |
---|
1591 | { |
---|
1592 | return 0; |
---|
1593 | } |
---|
1594 | #endif |
---|
1595 | ------------------------------------------ |
---|
1596 | ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o |
---|
1597 | Test succeeded |
---|
1598 | Try: /opt/local/bin/g++-mp-6 |
---|
1599 | Line: /opt/local/bin/g++-mp-6 -pipe -Os -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.10.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_1843_test |
---|
1600 | ---------- file ----------------------- |
---|
1601 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
---|
1602 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
---|
1603 | #ifdef TEST_KWSYS_CXX_HAS_CSTDIO |
---|
1604 | #include <cstdio> |
---|
1605 | int main() |
---|
1606 | { |
---|
1607 | return 0; |
---|
1608 | } |
---|
1609 | #endif |
---|
1610 | |
---|
1611 | #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG |
---|
1612 | long long f(long long n) |
---|
1613 | { |
---|
1614 | return n; |
---|
1615 | } |
---|
1616 | int main() |
---|
1617 | { |
---|
1618 | long long n = 0; |
---|
1619 | return static_cast<int>(f(n)); |
---|
1620 | } |
---|
1621 | #endif |
---|
1622 | |
---|
1623 | #ifdef TEST_KWSYS_CXX_HAS___INT64 |
---|
1624 | __int64 f(__int64 n) |
---|
1625 | { |
---|
1626 | return n; |
---|
1627 | } |
---|
1628 | int main() |
---|
1629 | { |
---|
1630 | __int64 n = 0; |
---|
1631 | return static_cast<int>(f(n)); |
---|
1632 | } |
---|
1633 | #endif |
---|
1634 | |
---|
1635 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
---|
1636 | #include <sys/types.h> |
---|
1637 | |
---|
1638 | #include <sys/stat.h> |
---|
1639 | #include <unistd.h> |
---|
1640 | int main() |
---|
1641 | { |
---|
1642 | struct stat stat1; |
---|
1643 | (void)stat1.st_mtim.tv_sec; |
---|
1644 | (void)stat1.st_mtim.tv_nsec; |
---|
1645 | return 0; |
---|
1646 | } |
---|
1647 | #endif |
---|
1648 | |
---|
1649 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
---|
1650 | #include <sys/types.h> |
---|
1651 | |
---|
1652 | #include <sys/stat.h> |
---|
1653 | #include <unistd.h> |
---|
1654 | int main() |
---|
1655 | { |
---|
1656 | struct stat stat1; |
---|
1657 | (void)stat1.st_mtimespec.tv_sec; |
---|
1658 | (void)stat1.st_mtimespec.tv_nsec; |
---|
1659 | return 0; |
---|
1660 | } |
---|
1661 | #endif |
---|
1662 | |
---|
1663 | #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 |
---|
1664 | void function(long**) |
---|
1665 | { |
---|
1666 | } |
---|
1667 | int main() |
---|
1668 | { |
---|
1669 | __int64** p = 0; |
---|
1670 | function(p); |
---|
1671 | return 0; |
---|
1672 | } |
---|
1673 | #endif |
---|
1674 | |
---|
1675 | #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 |
---|
1676 | void function(long long**) |
---|
1677 | { |
---|
1678 | } |
---|
1679 | int main() |
---|
1680 | { |
---|
1681 | __int64** p = 0; |
---|
1682 | function(p); |
---|
1683 | return 0; |
---|
1684 | } |
---|
1685 | #endif |
---|
1686 | |
---|
1687 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG |
---|
1688 | #include <iostream> |
---|
1689 | int test_istream(std::istream& is, long long& x) |
---|
1690 | { |
---|
1691 | return (is >> x) ? 1 : 0; |
---|
1692 | } |
---|
1693 | int main() |
---|
1694 | { |
---|
1695 | long long x = 0; |
---|
1696 | return test_istream(std::cin, x); |
---|
1697 | } |
---|
1698 | #endif |
---|
1699 | |
---|
1700 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG |
---|
1701 | #include <iostream> |
---|
1702 | int test_ostream(std::ostream& os, long long x) |
---|
1703 | { |
---|
1704 | return (os << x) ? 1 : 0; |
---|
1705 | } |
---|
1706 | int main() |
---|
1707 | { |
---|
1708 | long long x = 0; |
---|
1709 | return test_ostream(std::cout, x); |
---|
1710 | } |
---|
1711 | #endif |
---|
1712 | |
---|
1713 | #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 |
---|
1714 | #include <iostream> |
---|
1715 | int test_istream(std::istream& is, __int64& x) |
---|
1716 | { |
---|
1717 | return (is >> x) ? 1 : 0; |
---|
1718 | } |
---|
1719 | int main() |
---|
1720 | { |
---|
1721 | __int64 x = 0; |
---|
1722 | return test_istream(std::cin, x); |
---|
1723 | } |
---|
1724 | #endif |
---|
1725 | |
---|
1726 | #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 |
---|
1727 | #include <iostream> |
---|
1728 | int test_ostream(std::ostream& os, __int64 x) |
---|
1729 | { |
---|
1730 | return (os << x) ? 1 : 0; |
---|
1731 | } |
---|
1732 | int main() |
---|
1733 | { |
---|
1734 | __int64 x = 0; |
---|
1735 | return test_ostream(std::cout, x); |
---|
1736 | } |
---|
1737 | #endif |
---|
1738 | |
---|
1739 | #ifdef TEST_KWSYS_LFS_WORKS |
---|
1740 | /* Return 0 when LFS is available and 1 otherwise. */ |
---|
1741 | #define _LARGEFILE_SOURCE |
---|
1742 | #define _LARGEFILE64_SOURCE |
---|
1743 | #define _LARGE_FILES |
---|
1744 | #define _FILE_OFFSET_BITS 64 |
---|
1745 | #include <sys/types.h> |
---|
1746 | |
---|
1747 | #include <assert.h> |
---|
1748 | #include <sys/stat.h> |
---|
1749 | #if KWSYS_CXX_HAS_CSTDIO |
---|
1750 | #include <cstdio> |
---|
1751 | #endif |
---|
1752 | #include <stdio.h> |
---|
1753 | |
---|
1754 | int main(int, char** argv) |
---|
1755 | { |
---|
1756 | /* check that off_t can hold 2^63 - 1 and perform basic operations... */ |
---|
1757 | #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) |
---|
1758 | if (OFF_T_64 % 2147483647 != 1) |
---|
1759 | return 1; |
---|
1760 | |
---|
1761 | // stat breaks on SCO OpenServer |
---|
1762 | struct stat buf; |
---|
1763 | stat(argv[0], &buf); |
---|
1764 | if (!S_ISREG(buf.st_mode)) |
---|
1765 | return 2; |
---|
1766 | |
---|
1767 | FILE* file = fopen(argv[0], "r"); |
---|
1768 | off_t offset = ftello(file); |
---|
1769 | fseek(file, offset, SEEK_CUR); |
---|
1770 | fclose(file); |
---|
1771 | return 0; |
---|
1772 | } |
---|
1773 | #endif |
---|
1774 | |
---|
1775 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
---|
1776 | #include <stdlib.h> |
---|
1777 | int main() |
---|
1778 | { |
---|
1779 | return setenv("A", "B", 1); |
---|
1780 | } |
---|
1781 | #endif |
---|
1782 | |
---|
1783 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
---|
1784 | #include <stdlib.h> |
---|
1785 | int main() |
---|
1786 | { |
---|
1787 | unsetenv("A"); |
---|
1788 | return 0; |
---|
1789 | } |
---|
1790 | #endif |
---|
1791 | |
---|
1792 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
---|
1793 | #include <stdlib.h> |
---|
1794 | int main() |
---|
1795 | { |
---|
1796 | char* e = environ[0]; |
---|
1797 | return e ? 0 : 1; |
---|
1798 | } |
---|
1799 | #endif |
---|
1800 | |
---|
1801 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
---|
1802 | // Match feature definitions from SystemInformation.cxx |
---|
1803 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1804 | #define _GNU_SOURCE |
---|
1805 | #endif |
---|
1806 | #include <stdlib.h> |
---|
1807 | int main() |
---|
1808 | { |
---|
1809 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
---|
1810 | return getloadavg(loadavg, 3); |
---|
1811 | } |
---|
1812 | #endif |
---|
1813 | |
---|
1814 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
---|
1815 | #if defined(KWSYS_HAS_LFS) |
---|
1816 | #define _LARGEFILE_SOURCE |
---|
1817 | #define _LARGEFILE64_SOURCE |
---|
1818 | #define _LARGE_FILES |
---|
1819 | #define _FILE_OFFSET_BITS 64 |
---|
1820 | #endif |
---|
1821 | #include <sys/resource.h> |
---|
1822 | int main() |
---|
1823 | { |
---|
1824 | struct rlimit64 rlim; |
---|
1825 | return getrlimit64(0, &rlim); |
---|
1826 | } |
---|
1827 | #endif |
---|
1828 | |
---|
1829 | #ifdef TEST_KWSYS_CXX_HAS_ATOLL |
---|
1830 | #include <stdlib.h> |
---|
1831 | int main() |
---|
1832 | { |
---|
1833 | const char* str = "1024"; |
---|
1834 | return static_cast<int>(atoll(str)); |
---|
1835 | } |
---|
1836 | #endif |
---|
1837 | |
---|
1838 | #ifdef TEST_KWSYS_CXX_HAS_ATOL |
---|
1839 | #include <stdlib.h> |
---|
1840 | int main() |
---|
1841 | { |
---|
1842 | const char* str = "1024"; |
---|
1843 | return static_cast<int>(atol(str)); |
---|
1844 | } |
---|
1845 | #endif |
---|
1846 | |
---|
1847 | #ifdef TEST_KWSYS_CXX_HAS__ATOI64 |
---|
1848 | #include <stdlib.h> |
---|
1849 | int main() |
---|
1850 | { |
---|
1851 | const char* str = "1024"; |
---|
1852 | return static_cast<int>(_atoi64(str)); |
---|
1853 | } |
---|
1854 | #endif |
---|
1855 | |
---|
1856 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
---|
1857 | #include <sys/time.h> |
---|
1858 | int main() |
---|
1859 | { |
---|
1860 | struct timeval* current_time = 0; |
---|
1861 | return utimes("/example", current_time); |
---|
1862 | } |
---|
1863 | #endif |
---|
1864 | |
---|
1865 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
---|
1866 | #include <fcntl.h> |
---|
1867 | #include <sys/stat.h> |
---|
1868 | #if defined(__APPLE__) |
---|
1869 | #include <AvailabilityMacros.h> |
---|
1870 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
---|
1871 | #error "utimensat not available on macOS < 10.13" |
---|
1872 | #endif |
---|
1873 | #endif |
---|
1874 | int main() |
---|
1875 | { |
---|
1876 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
---|
1877 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
---|
1878 | } |
---|
1879 | #endif |
---|
1880 | |
---|
1881 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
---|
1882 | #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
---|
1883 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
---|
1884 | backtrace doesnt work with this compiler or os |
---|
1885 | #endif |
---|
1886 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1887 | #define _GNU_SOURCE |
---|
1888 | #endif |
---|
1889 | #include <execinfo.h> |
---|
1890 | int main() |
---|
1891 | { |
---|
1892 | void* stackSymbols[256]; |
---|
1893 | backtrace(stackSymbols, 256); |
---|
1894 | backtrace_symbols(&stackSymbols[0], 1); |
---|
1895 | return 0; |
---|
1896 | } |
---|
1897 | #endif |
---|
1898 | |
---|
1899 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
---|
1900 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1901 | #define _GNU_SOURCE |
---|
1902 | #endif |
---|
1903 | #include <dlfcn.h> |
---|
1904 | int main() |
---|
1905 | { |
---|
1906 | Dl_info info; |
---|
1907 | int ierr = dladdr((void*)main, &info); |
---|
1908 | return 0; |
---|
1909 | } |
---|
1910 | #endif |
---|
1911 | |
---|
1912 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
---|
1913 | #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
---|
1914 | #define _GNU_SOURCE |
---|
1915 | #endif |
---|
1916 | #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
---|
1917 | __SUNPRO_CC_COMPAT == 'G' |
---|
1918 | #include <iostream> |
---|
1919 | #endif |
---|
1920 | #include <cxxabi.h> |
---|
1921 | int main() |
---|
1922 | { |
---|
1923 | int status = 0; |
---|
1924 | size_t bufferLen = 512; |
---|
1925 | char buffer[512] = { '\0' }; |
---|
1926 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
---|
1927 | char* demangledFunction = |
---|
1928 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
---|
1929 | return status; |
---|
1930 | } |
---|
1931 | #endif |
---|
1932 | |
---|
1933 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM |
---|
1934 | int main() |
---|
1935 | { |
---|
1936 | int a = 1; |
---|
1937 | __asm { |
---|
1938 | xor EBX, EBX; |
---|
1939 | mov a, EBX; |
---|
1940 | } |
---|
1941 | |
---|
1942 | return a; |
---|
1943 | } |
---|
1944 | #endif |
---|
1945 | |
---|
1946 | #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID |
---|
1947 | int main() |
---|
1948 | { |
---|
1949 | int a = 0; |
---|
1950 | __asm { |
---|
1951 | xor EAX, EAX; |
---|
1952 | cpuid; |
---|
1953 | mov a, EAX; |
---|
1954 | } |
---|
1955 | |
---|
1956 | return a; |
---|
1957 | } |
---|
1958 | #endif |
---|
1959 | |
---|
1960 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
---|
1961 | #include <string> |
---|
1962 | void f(std::wstring*) |
---|
1963 | { |
---|
1964 | } |
---|
1965 | int main() |
---|
1966 | { |
---|
1967 | return 0; |
---|
1968 | } |
---|
1969 | #endif |
---|
1970 | |
---|
1971 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
---|
1972 | #include <ext/stdio_filebuf.h> |
---|
1973 | int main() |
---|
1974 | { |
---|
1975 | return 0; |
---|
1976 | } |
---|
1977 | #endif |
---|
1978 | ------------------------------------------ |
---|
1979 | ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /opt/local/lib/gcc6/gcc/ppc-apple-darwin8/6.4.0/crt3.o |
---|
1980 | Test succeeded |
---|