diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-21 16:42:51 +0100 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:43:35 +0100 |
commit | c4de53373c059dba8933ed1fed32f90a8ff2d0fb (patch) | |
tree | 18bed2eeb2ef04702323c2b442664e912ed742d1 | |
parent | dea260445ee5d6e5a8e61d760a7abd8cebe0cae1 (diff) | |
download | perl-c4de53373c059dba8933ed1fed32f90a8ff2d0fb.tar.gz |
Configure: fix nl_langinfo_l() probe
This corresponds to metaconfig ad82f5bfbeafc125c0aed2b83391ed8d43bf31b2.
-rwxr-xr-x | Configure | 79 |
1 files changed, 41 insertions, 38 deletions
@@ -20010,54 +20010,57 @@ thread_start(void * arg) } int main() { - char * main_buffer; - char save_main_buffer[1000]; - pthread_t subthread; - pthread_attr_t attr; - - main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0)); - - /* If too large for our generous allowance, just assume we don't have - * it. */ - if (strlen(main_buffer) >= sizeof(save_main_buffer)) { - exit(1); - } + char * main_buffer; + char save_main_buffer[1000]; + pthread_t subthread; + pthread_attr_t attr; + + main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0)); + + /* If too large for our generous allowance, just assume we don't have + * it. */ + if (strlen(main_buffer) >= sizeof(save_main_buffer)) { + exit(1); + } - strcpy(save_main_buffer, main_buffer); + strcpy(save_main_buffer, main_buffer); - if (pthread_attr_init(&attr) != 0) { - exit(1); - } + if (pthread_attr_init(&attr) != 0) { + exit(1); + } - if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) { - exit(1); - } + if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) { + exit(1); + } - if (pthread_join(subthread, NULL) != 0) { - exit(1); - } + if (pthread_join(subthread, NULL) != 0) { + exit(1); + } - exit(! (strcmp(main_buffer, save_main_buffer) == 0)); + exit(! (strcmp(main_buffer, save_main_buffer) == 0)); } EOCP case "$usethreads" in define) - set try - if eval $compile; then - echo "Your system has nl_langinfo_l()..." >&4 - if $run ./try; then - echo "and it is thread-safe (just as I'd hoped)." >&4 - d_thread_safe_nl_langinfo_l="$define" - echo "$d_thread_safe_nl_langinfo_l" >&4 - else - echo "but it isn't thread-safe, so we won't use it." >&4 - fi - else - echo "your system does not have nl_langinfo_l()" >&4 - fi - ;; + set try + if eval $compile; then + echo "Your system has nl_langinfo_l()..." >&4 + if $run ./try; then + echo "and it is thread-safe (just as I'd hoped)." >&4 + d_thread_safe_nl_langinfo_l="$define" + echo "$d_thread_safe_nl_langinfo_l" >&4 + else + echo "but it isn't thread-safe, so we won't use it." >&4 + fi + else + echo "your system does not have nl_langinfo_l()" >&4 + fi + ;; *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4 - esac +esac +if test X"$d_thread_safe_nl_langinfo_l" = X; then + d_thread_safe_nl_langinfo_l="$undef" +fi $rm_try : see if time exists |