OSDN Git Service

2004-07-20 David S. Miller <davem@nuts.davemloft.net>
[pf3gnuchains/gcc-fork.git] / gcc / config / sol2-c.c
1 /* Solaris support needed only by C/C++ frontends.
2    Copyright (C) 2004  Free Software Foundation, Inc.
3    Contributed by CodeSourcery, LLC.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tree.h"
26
27 #include "c-format.h"
28 #include "intl.h"
29
30 /* cmn_err only accepts "l" and "ll".  */
31 static const format_length_info cmn_err_length_specs[] =
32 {
33   { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89 },
34   { NULL, 0, 0, NULL, 0, 0 }
35 };
36
37 static const format_flag_spec cmn_err_flag_specs[] =
38 {
39   { 'w',  0, 0, N_("field width"),     N_("field width in printf format"),     STD_C89 },
40   { 'L',  0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
41   { 0, 0, 0, NULL, NULL, 0 }
42 };
43
44
45 static const format_flag_pair cmn_err_flag_pairs[] =
46 {
47   { 0, 0, 0, 0 }
48 };
49
50 static const format_char_info bitfield_string_type =
51   { "b",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "cR", NULL };
52
53 static const format_char_info cmn_err_char_table[] =
54 {
55   /* C89 conversion specifiers.  */
56   { "dD",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
57   { "oOxX",0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
58   { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
59   { "c",   0, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
60   { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "cR", NULL },
61   { "b",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   &bitfield_string_type },
62   { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
63 };
64
65 const format_kind_info solaris_format_types[] = {
66   { "cmn_err",  cmn_err_length_specs,  cmn_err_char_table, "", NULL,
67     cmn_err_flag_specs, cmn_err_flag_pairs,
68     FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK,
69     'w', 0, 0, 0, 'L',
70     &integer_type_node, &integer_type_node
71   }
72 };