Use inttypes.h to get uint64_t print format string
Code generators should not include _pli_types.h to get standard int types and strings. Use the inttypes.h header file instead.
This commit is contained in:
parent
c899a6a52e
commit
190aefcf89
|
|
@ -13,7 +13,7 @@ AC_CANONICAL_HOST
|
|||
# Combined check for Microsoft-related bogosities; sets WIN32 if found
|
||||
AX_WIN32
|
||||
|
||||
AC_CHECK_HEADERS(malloc.h stdint.h)
|
||||
AC_CHECK_HEADERS(malloc.h stdint.h inttypes.h)
|
||||
|
||||
# may modify CPPFLAGS and CFLAGS
|
||||
AX_CPP_PRECOMP
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
/*
|
||||
* This file includes functions for evaluating REAL expressions.
|
||||
*/
|
||||
# include "_pli_types.h" /* To get the UINT64 format */
|
||||
# include "vvp_config.h"
|
||||
# include "vvp_priv.h"
|
||||
# include <string.h>
|
||||
|
|
@ -31,6 +30,15 @@
|
|||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# ifndef __STDC_FORMAT_MACROS
|
||||
# define __STDC_FORMAT_MACROS 1
|
||||
# endif
|
||||
# include <inttypes.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
# include <math.h>
|
||||
# include <assert.h>
|
||||
|
||||
|
|
@ -64,7 +72,7 @@ static int draw_number_bool64(ivl_expr_t exp)
|
|||
}
|
||||
|
||||
res = allocate_word();
|
||||
fprintf(vvp_out, " %%ix/load %d, %" PLI_UINT64_FMT ";\n", res, val);
|
||||
fprintf(vvp_out, " %%ix/load %d, %" PRIu64 ";\n", res, val);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
# undef HAVE_MALLOC_H
|
||||
# undef HAVE_STDINT_H
|
||||
# undef HAVE_INTTYPES_H
|
||||
|
||||
# undef _LARGEFILE_SOURCE
|
||||
# undef _LARGEFILE64_SOURCE
|
||||
|
|
|
|||
Loading…
Reference in New Issue