Add support for text macros with arguments.
[iverilog.git] / _pli_types.h.in
blob4de089f20828361bf16ce8fb43e240f5a015f47d
1 #ifndef PLI_TYPES
2 #define PLI_TYPES
3 /*
4 * Copyright (c) 2003 Stephen Williams (steve@icarus.com)
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
10 * any later version.
12 * This program 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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 #ifdef HAVE_CVS_IDENT
22 #ident "$Id: _pli_types.h.in,v 1.8 2007/06/05 21:32:30 steve Exp $"
23 #endif
25 # undef HAVE_INTTYPES_H
27 #ifdef HAVE_INTTYPES_H
30 * If the host environment has the stdint.h header file,
31 * then use that to size our PLI types.
33 #ifndef __STDC_FORMAT_MACROS
34 # define __STDC_FORMAT_MACROS
35 #endif
37 # include <inttypes.h>
38 typedef uint64_t PLI_UINT64;
39 typedef int64_t PLI_INT64;
40 typedef uint32_t PLI_UINT32;
41 typedef int32_t PLI_INT32;
43 typedef signed short PLI_INT16;
44 typedef unsigned short PLI_UINT16;
45 typedef char PLI_BYTE8;
46 typedef unsigned char PLI_UBYTE8;
48 # define PLI_UINT64_FMT PRIu64
50 #else
53 * If we do not have the c99 stdint.h header file, then use
54 * configure detection to guess the pli types ourselves.
57 # define SIZEOF_UNSIGNED_LONG_LONG 8
58 # define SIZEOF_UNSIGNED_LONG 8
59 # define SIZEOF_UNSIGNED 4
61 #if SIZEOF_UNSIGNED >= 8
62 typedef unsigned PLI_UINT64;
63 typedef int PLI_INT64;
64 # define PLI_UINT64_FMT "u"
65 #else
66 # if SIZEOF_UNSIGNED_LONG >= 8
67 typedef unsigned long PLI_UINT64;
68 typedef long PLI_INT64;
69 # define PLI_UINT64_FMT "lu"
70 # else
71 # if SIZEOF_UNSIGNED_LONG_LONG > SIZEOF_UNSIGNED_LONG
72 typedef unsigned long long PLI_UINT64;
73 typedef long long PLI_INT64;
74 # define PLI_UINT64_FMT "llu"
75 # else
76 typedef unsigned long PLI_UINT64;
77 typedef long PLI_INT64;
78 # define PLI_UINT64_FMT "lu"
79 # endif
80 # endif
81 #endif
83 typedef signed int PLI_INT32;
84 typedef unsigned int PLI_UINT32;
85 typedef signed short PLI_INT16;
86 typedef unsigned short PLI_UINT16;
87 typedef char PLI_BYTE8;
88 typedef unsigned char PLI_UBYTE8;
89 #endif
92 * $Log: _pli_types.h.in,v $
93 * Revision 1.8 2007/06/05 21:32:30 steve
94 * More standard PLI_BYTE8.
96 * Revision 1.7 2003/11/12 02:38:44 steve
97 * Clean up manual definitions of PLI_UINT64_FMT.
99 * Revision 1.6 2003/11/08 20:06:21 steve
100 * Spelling fixes in comments.
102 * Revision 1.5 2003/10/29 03:28:27 steve
103 * Add the PLU_UINT64_FMT string for formatting output.
105 * Revision 1.4 2003/10/29 03:23:12 steve
106 * Portably handle time format of VCD prints.
108 * Revision 1.3 2003/10/02 21:30:06 steve
109 * Use configured TIME_FMT in vcd dump printf.
111 * Revision 1.2 2003/10/02 19:33:44 steve
112 * Put libraries in libdir64.
114 * Revision 1.1 2003/09/30 01:33:13 steve
115 * Add PLI_UINT64 to _pli_types.h.
117 * Revision 1.2 2003/05/26 04:39:16 steve
118 * Typo type name.
120 * Revision 1.1 2003/02/17 06:39:47 steve
121 * Add at least minimal implementations for several
122 * acc_ functions. Add support for standard ACC
123 * string handling.
125 * Add the _pli_types.h header file to carry the
126 * IEEE1364-2001 standard PLI type declarations.
129 #endif