Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
Cc: "'Tom Tromey'" <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] Handle cygwin wchar_t specifics
Date: Sat, 16 Apr 2011 16:25:00 -0000	[thread overview]
Message-ID: <20110416162455.GA5599@host1.jankratochvil.net> (raw)
In-Reply-To: <005101cbfc50$193136b0$4b93a410$@muller@ics-cnrs.unistra.fr>

On Sat, 16 Apr 2011 18:05:19 +0200, Pierre Muller wrote:
>   Do you know of any way to get the size of wchar_t?
>   I suspect we will need to add this to the configure scripts...
> But I am still very bad on that part.

I do not follow the platform specifics of the problem but this specific
technical task is attached.  On GNU/Linux I get in config.h:

/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4

info '(autoconf)AC_CHECK_SIZEOF'
Fro cross-compilation the default is 4, for some unknown error it is 0.


HTH,
Jan


--- a/gdb/config.in
+++ b/gdb/config.in
@@ -804,6 +804,9 @@
 /* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
+/* The size of `wchar_t', as computed by sizeof. */
+#undef SIZEOF_WCHAR_T
+
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'size_t'. */
 #undef SIZE_T_SUFFIX
--- a/gdb/configure
+++ b/gdb/configure
@@ -11637,6 +11637,44 @@ _ACEOF
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
+$as_echo_n "checking size of wchar_t... " >&6; }
+if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t"        "
+#include <wchar.h>
+#include <wctype.h>
+
+"; then :
+
+else
+  if test "$ac_cv_type_wchar_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (wchar_t)
+See \`config.log' for more details." "$LINENO" 5; }; }
+   else
+     ac_cv_sizeof_wchar_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5
+$as_echo "$ac_cv_sizeof_wchar_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
+_ACEOF
+
+
 
 # ------------------------------------- #
 # Checks for compiler characteristics.  #
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -976,6 +976,10 @@ AC_CHECK_TYPES(socklen_t, [], [],
 [#include <sys/types.h>
 #include <sys/socket.h>
 ])
+AC_CHECK_SIZEOF([wchar_t], 4, [
+#include <wchar.h>
+#include <wctype.h>
+])
 
 # ------------------------------------- #
 # Checks for compiler characteristics.  #


  reply	other threads:[~2011-04-16 16:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5928.31498147479$1302882967@news.gmane.org>
2011-04-15 18:16 ` Tom Tromey
2011-04-16 16:05   ` Pierre Muller
2011-04-16 16:25     ` Jan Kratochvil [this message]
2011-04-16 21:29       ` [RFA-v2] " Pierre Muller
2011-04-16 22:35         ` Jan Kratochvil
     [not found]       ` <000001cbfc7d$3f67f440$be37dcc0$%muller@ics-cnrs.unistra.fr>
2011-04-17  2:55         ` Eli Zaretskii
2011-04-18 10:36           ` Pierre Muller
     [not found]           ` <00a801cbfdb4$551214a0$ff363de0$%muller@ics-cnrs.unistra.fr>
2011-04-18 10:57             ` Eli Zaretskii
2011-04-18 15:14           ` [RFA-v3] " Pierre Muller
     [not found]           ` <21014.6501930014$1303139687@news.gmane.org>
2011-04-18 17:18             ` Tom Tromey
2011-04-19  9:18               ` [RFC-v4] " Pierre Muller
     [not found]               ` <004f01cbfe72$adddeb40$0999c1c0$%muller@ics-cnrs.unistra.fr>
2011-04-19  9:34                 ` Eli Zaretskii
     [not found]               ` <34716.7311156683$1303204711@news.gmane.org>
2011-04-19 13:19                 ` Tom Tromey
2011-04-19 13:56                   ` [RFC-v5] " Pierre Muller
     [not found]                   ` <16656.7281041809$1303221408@news.gmane.org>
2011-04-19 17:50                     ` Tom Tromey
2011-04-20  7:59                       ` Pierre Muller
2011-04-20 21:08                         ` Pedro Alves
2011-04-21  6:57                           ` Pierre Muller
2011-04-21  7:17                             ` [RFA-v6] " Pierre Muller
2011-04-21  9:02                               ` Pierre Muller
     [not found]                               ` <24274.3825926029$1303376558@news.gmane.org>
2011-04-21 14:14                                 ` Tom Tromey
2011-04-21 14:27                                   ` Pierre Muller
     [not found]                                   ` <4691.37052209607$1303396084@news.gmane.org>
2011-04-21 15:06                                     ` Tom Tromey
2011-04-21 16:39                                       ` Pierre Muller
     [not found]                                       ` <25400.1310132027$1303403986@news.gmane.org>
2011-04-21 20:25                                         ` Tom Tromey
2011-04-21 21:18                                           ` 7.3 commit " Pierre Muller
     [not found]                           ` <15550.7422438406$1303369059@news.gmane.org>
2011-04-21 14:10                             ` [RFC-v5] " Tom Tromey
     [not found]                       ` <420.768399681215$1303286406@news.gmane.org>
2011-04-20 20:21                         ` Tom Tromey
2011-04-16 21:24     ` [RFA] " Tom Tromey
2011-04-18 20:07   ` Corinna Vinschen
2011-04-15 15:55 Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110416162455.GA5599@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox