Make ivl_alloc.h the last include so it doesn't effect any system includes.

In ivl_alloc.h we redefine malloc(), realloc() and calloc() to have
standard error checking. We don't want to do this for anything that
comes from the standard headers. This specifically doesn't work if
a C++ header files does std::malloc, etc.

Also change to -W instead of -Wextra since that is more portable. I
plan to add a check from -Wextra and use it when available since it
is more descriptive.
This commit is contained in:
Cary R 2010-10-23 15:52:56 -07:00 committed by Stephen Williams
parent 225ca1e205
commit a4a7b0a09d
67 changed files with 88 additions and 79 deletions

View File

@ -18,10 +18,10 @@
*/
# include "StringHeap.h"
# include "ivl_alloc.h"
# include <cstdlib>
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
#ifdef CHECK_WITH_VALGRIND
static char **string_pool = NULL;

View File

@ -17,7 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
# include "ivl_alloc.h"
# include <vpi_user.h>
# include <veriuser.h>
# include <stdlib.h>
@ -25,6 +24,7 @@
# include <assert.h>
# include "config.h"
# include "ivl_dlfcn.h"
# include "ivl_alloc.h"
typedef void* (*funcvp)(void);

View File

@ -71,7 +71,7 @@ AC_SUBST(WARNING_FLAGS_CXX, [""])
else
AC_SUBST(DEPENDENCY_FLAG, [-MD])
AC_SUBST(WARNING_FLAGS, ["-Wall -Wshadow"])
AC_SUBST(WARNING_FLAGS_CXX, ["-Wextra"])
AC_SUBST(WARNING_FLAGS_CXX, ["-W"])
fi
AC_LANG(C++)

View File

@ -50,7 +50,6 @@ const char HELP[] =
#define MAXSIZE 4096
#include "ivl_alloc.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -64,11 +63,13 @@ const char HELP[] =
#endif
#ifdef __MINGW32__
#include <windows.h>
# include <windows.h>
# include <io.h>
#ifdef HAVE_LIBIBERTY_H
#include <libiberty.h>
# include <libiberty.h>
#endif
#endif
#include <fcntl.h>
#if HAVE_GETOPT_H
#include <getopt.h>
@ -94,6 +95,7 @@ extern const char*optarg;
# include "globals.h"
#include "cfparse_misc.h" /* cfparse() */
#include "ivl_alloc.h"
#ifdef __MINGW32__
const char sep = '\\';
@ -211,8 +213,6 @@ char *get_cmd_file()
}
#ifdef __MINGW32__
# include <io.h>
# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;
@ -225,7 +225,6 @@ static FILE*fopen_safe(const char*path)
return file;
}
#else
# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;

View File

@ -17,10 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <stdio.h>
# include "ivl_alloc.h"
char* substitutions(const char*str)

View File

@ -20,7 +20,6 @@
# include "config.h"
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@ -28,6 +27,7 @@
# include <assert.h>
# include "globals.h"
# include "ivl_alloc.h"
static void output_init();
#define YY_USER_INIT output_init()

View File

@ -37,7 +37,6 @@ const char NOTICE[] =
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
;
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
@ -47,6 +46,7 @@ const char NOTICE[] =
# include <getopt.h>
#endif
# include "globals.h"
# include "ivl_alloc.h"
#if defined(__MINGW32__) && !defined(HAVE_GETOPT_H)
extern int getopt(int argc, char*argv[], const char*fmt);

View File

@ -17,12 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "ivl_alloc.h"
#include <vpi_user.h>
#include <acc_user.h>
#include <stdlib.h>
#include "priv.h"
#include <assert.h>
#include "ivl_alloc.h"
/*
* This is the structure of a record that I use locally to hold the

View File

@ -23,7 +23,6 @@
* via VPI. This is extremely ugly, so don't look after eating dinner.
*/
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
@ -32,6 +31,7 @@
# include "priv.h"
# include "vpi_user.h"
# include "veriuser.h"
# include "ivl_alloc.h"
/*
* local structure used to hold the persistent veriusertfs data

View File

@ -17,10 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
# include "ivl_alloc.h"
# include <veriuser.h>
# include <vpi_user.h>
# include <stdlib.h>
# include "ivl_alloc.h"
/*
* Keep a list of sys handle to work area bindings.

View File

@ -21,7 +21,6 @@
# include "util.h"
# include "parse_api.h"
# include "compiler.h"
# include "ivl_alloc.h"
# include <iostream>
# include <map>
# include <cstdlib>
@ -31,6 +30,7 @@
# include <dirent.h>
# include <cctype>
# include <cassert>
# include "ivl_alloc.h"
/*
* The module library items are maps of key names to file name within

View File

@ -38,7 +38,6 @@ const char NOTICE[] =
" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
;
# include "ivl_alloc.h"
# include <cstdio>
# include <iostream>
# include <fstream>
@ -89,6 +88,8 @@ static void signals_handler(int sig)
}
#endif
# include "ivl_alloc.h"
/* Count errors detected in flag processing. */
unsigned flag_errors = 0;

View File

@ -22,12 +22,12 @@
# include <iostream>
# include "netlist.h"
# include "ivl_alloc.h"
# include <sstream>
# include <cstring>
# include <string>
# include <typeinfo>
# include <cstdlib>
# include "ivl_alloc.h"
void Nexus::connect(Link&r)
{

View File

@ -28,7 +28,6 @@
# include "PGenerate.h"
# include "PSpec.h"
# include "discipline.h"
# include "ivl_alloc.h"
# include <list>
# include <map>
# include <cassert>
@ -39,6 +38,7 @@
# include <cstdlib>
# include "ivl_assert.h"
# include "ivl_alloc.h"
map<perm_string,Module*> pform_modules;
map<perm_string,PUdp*> pform_primitives;

View File

@ -22,13 +22,13 @@
# include <iostream>
# include "ivl_alloc.h"
# include <cstring>
# include "target.h"
# include "ivl_target.h"
# include "compiler.h"
# include "t-dll.h"
# include <cstdlib>
# include "ivl_alloc.h"
bool dll_target::process(const NetAnalogTop*net)
{

View File

@ -21,10 +21,10 @@
# include "StringHeap.h"
# include "t-dll.h"
# include "discipline.h"
# include "ivl_alloc.h"
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include "ivl_alloc.h"
static StringHeap api_strings;

View File

@ -19,7 +19,6 @@
# include "config.h"
# include "ivl_alloc.h"
# include <iostream>
# include <cstring>
@ -27,6 +26,7 @@
# include "netlist.h"
# include <cassert>
# include <cstdlib>
# include "ivl_alloc.h"
/*
* This is a little convenience function for converting a NetExpr

View File

@ -22,13 +22,13 @@
# include <iostream>
# include "ivl_alloc.h"
# include <cstring>
# include "target.h"
# include "ivl_target.h"
# include "compiler.h"
# include "t-dll.h"
# include <cstdlib>
# include "ivl_alloc.h"
bool dll_target::process(const NetProcTop*net)
{

View File

@ -21,7 +21,6 @@
# include <iostream>
# include "ivl_alloc.h"
# include <cstring>
# include <cstdio> // sprintf()
# include "compiler.h"
@ -30,6 +29,7 @@
# include "discipline.h"
# include <cstdlib>
# include "ivl_assert.h"
# include "ivl_alloc.h"
struct dll_target dll_target_obj;

View File

@ -19,10 +19,10 @@
# include "device.h"
# include "fpga_priv.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include "ivl_alloc.h"
struct nexus_recall {
struct nexus_recall*next;

View File

@ -18,10 +18,10 @@
*/
# include "edif.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include "ivl_alloc.h"
typedef enum property_e {
PRP_NONE = 0,

View File

@ -18,9 +18,9 @@
*/
# include "fpga_priv.h"
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include "ivl_alloc.h"
static size_t xnf_mangle_scope_name(ivl_scope_t net, char*buf, size_t nbuf)
{

View File

@ -21,10 +21,10 @@
# include "generic.h"
# include "xilinx.h"
# include "fpga_priv.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include "ivl_alloc.h"
edif_cell_t xilinx_cell_buf(edif_xlibrary_t xlib)
{

View File

@ -20,10 +20,10 @@
# include "config.h"
# include "priv.h"
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
static void draw_macrocell_modes(FILE*jfd)
{

View File

@ -20,11 +20,11 @@
# include "config.h"
# include "ivl_target.h"
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# include "priv.h"
# include "ivl_alloc.h"
/*
* By the time we get here, all the flip-flops have been placed in

View File

@ -25,10 +25,10 @@
# include "priv.h"
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
extern void dump_final_design(FILE*out);

View File

@ -28,11 +28,11 @@
# include "version_tag.h"
# include "config.h"
# include "priv.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <inttypes.h>
# include <string.h>
# include <assert.h>
# include "ivl_alloc.h"
static const char*version_string =
"Icarus Verilog STUB Code Generator " VERSION " (" VERSION_TAG ")\n\n"

View File

@ -18,12 +18,12 @@
*/
# include "vvp_priv.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <inttypes.h>
# include <assert.h>
# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf

View File

@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf

View File

@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
static void draw_eval_expr_dest(ivl_expr_t expr, struct vector_info dest,
int ok_flags);

View File

@ -18,10 +18,10 @@
*/
# include "vvp_priv.h"
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf

View File

@ -18,12 +18,12 @@
*/
# include "vvp_priv.h"
# include "ivl_alloc.h"
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <inttypes.h>
# include <assert.h>
# include "ivl_alloc.h"
#ifdef __MINGW32__ /* MinGW has inconsistent %p output. */
#define snprintf _snprintf

View File

@ -24,10 +24,10 @@ static void yyerror(const char*msg);
# include "vpi_user.h"
# include "sdf_parse_priv.h"
# include "sdf_priv.h"
# include "ivl_alloc.h"
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include "ivl_alloc.h"
/* This is the hierarchy separator to use. */
char sdf_use_hchar = '.';

View File

@ -19,10 +19,10 @@
# include "sys_priv.h"
# include "stringheap.h"
# include "ivl_alloc.h"
# include <string.h>
# include <stdlib.h>
# include <assert.h>
# include "ivl_alloc.h"
struct stringheap_cell {
struct stringheap_cell*next;

View File

@ -18,7 +18,6 @@
*/
# include "sys_priv.h"
# include "ivl_alloc.h"
# include <assert.h>
# include <string.h>
# include <errno.h>
@ -26,6 +25,7 @@
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include "ivl_alloc.h"
#define IS_MCD(mcd) !((mcd)>>31&1)

View File

@ -18,13 +18,13 @@
*/
# include "sys_priv.h"
# include "ivl_alloc.h"
# include <assert.h>
# include <ctype.h>
# include <errno.h>
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
# include "ivl_alloc.h"
#define IS_MCD(mcd) !((mcd)>>31&1)

View File

@ -25,12 +25,12 @@
* This file contains the implementations of the FST related functions.
*/
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
# include "ivl_alloc.h"
static char *dump_path = NULL;
static struct fstContext *dump_file = NULL;

View File

@ -26,13 +26,13 @@
* This file contains the implementations of the LXT related functions.
*/
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
# include "stringheap.h"
# include "ivl_alloc.h"
static char *dump_path = NULL;

View File

@ -26,13 +26,13 @@
* This file contains the implementations of the LXT2 related functions.
*/
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <time.h>
# include "stringheap.h"
# include <assert.h>
# include "ivl_alloc.h"
static char *dump_path = NULL;

View File

@ -18,11 +18,11 @@
*/
#include "sys_priv.h"
#include "ivl_alloc.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "ivl_alloc.h"
PLI_UINT64 timerec_to_time64(const struct t_vpi_time*timerec)
{

View File

@ -20,11 +20,11 @@
# include "sys_priv.h"
# include "sys_random.h"
# include "ivl_alloc.h"
# include <assert.h>
# include <stdlib.h>
# include <math.h>
# include <limits.h>
# include "ivl_alloc.h"
/*
* Implement the $random system function using the ``Mersenne

View File

@ -18,7 +18,6 @@
*/
# include "sys_priv.h"
# include "ivl_alloc.h"
# include <ctype.h>
# include <string.h>
# include <stdlib.h>
@ -26,6 +25,7 @@
# include <assert.h>
# include "sys_readmem_lex.h"
# include <sys/stat.h>
# include "ivl_alloc.h"
char **search_list = NULL;
unsigned sl_count = 0;

View File

@ -22,7 +22,6 @@
# define _SVID_SOURCE 1
# include "sys_priv.h"
# include "ivl_alloc.h"
# include <ctype.h>
# include <errno.h>
# include <string.h>
@ -30,6 +29,7 @@
# include <stdlib.h>
# include <math.h>
# include <assert.h>
# include "ivl_alloc.h"
struct byte_source {
const char*str;

View File

@ -24,12 +24,12 @@
* This file contains the implementations of the VCD related functions.
*/
# include "ivl_alloc.h"
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
# include <time.h>
# include "ivl_alloc.h"
static char *dump_path = NULL;
static FILE *dump_file = NULL;

View File

@ -20,12 +20,12 @@
*/
#include "vpi_config.h"
#include "ivl_alloc.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "vpi_user.h"
#include "ivl_alloc.h"
/* Single argument functions. */
typedef struct s_single_data {

View File

@ -20,12 +20,12 @@
*/
#include "vpi_config.h"
#include "ivl_alloc.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "vpi_user.h"
#include "ivl_alloc.h"
/*
* Compile time options: (set in the Makefile.)

View File

@ -26,13 +26,13 @@
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstdlib>
# include <cstring>
# include <climits>
# include <iostream>
# include "compile.h"
# include <cassert>
# include "ivl_alloc.h"
unsigned long count_net_arrays = 0;
unsigned long count_net_array_words = 0;

View File

@ -28,7 +28,6 @@
# include "vpi_priv.h"
# include "parse_misc.h"
# include "statistics.h"
# include "ivl_alloc.h"
# include <iostream>
# include <list>
# include <cstdlib>
@ -39,6 +38,8 @@
#include <windows.h>
#endif
# include "ivl_alloc.h"
unsigned compile_errors = 0;
/*
@ -76,7 +77,7 @@ struct opcode_table_s {
enum operand_e argt[OPERAND_MAX];
};
const static struct opcode_table_s opcode_table[] = {
static const struct opcode_table_s opcode_table[] = {
{ "%abs/wr", of_ABS_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%add", of_ADD, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%add/wr", of_ADD_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },

View File

@ -24,12 +24,12 @@
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#endif
#include "ivl_alloc.h"
#include <iostream>
#include <cstdlib>
#include <list>
#include <cassert>
#include <cmath>
#include "ivl_alloc.h"
void vvp_delay_t::calculate_min_delay_()
{
@ -526,7 +526,7 @@ static vvp_time64_t delay_from_edge(vvp_bit4_t a, vvp_bit4_t b,
vvp_time64_t array[12])
{
typedef delay_edge_t bit4_table4[4];
const static bit4_table4 edge_table[4] = {
static const bit4_table4 edge_table[4] = {
{ DELAY_EDGE_01, DELAY_EDGE_01, DELAY_EDGE_0x, DELAY_EDGE_0z },
{ DELAY_EDGE_10, DELAY_EDGE_10, DELAY_EDGE_1x, DELAY_EDGE_1z },
{ DELAY_EDGE_x0, DELAY_EDGE_x1, DELAY_EDGE_x0, DELAY_EDGE_xz },

View File

@ -25,9 +25,9 @@
# include "parse_misc.h"
# include "compile.h"
# include "parse.h"
# include "ivl_alloc.h"
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
static char* strdupnew(char const *str)
{

View File

@ -22,10 +22,10 @@
# include "parse_misc.h"
# include "compile.h"
# include "delay.h"
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cassert>
# include "ivl_alloc.h"
/*
* These are bits in the lexor.

View File

@ -19,9 +19,9 @@
# include "parse_misc.h"
# include "compile.h"
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include "ivl_alloc.h"
const char*yypath;
unsigned yyline;

View File

@ -28,7 +28,6 @@
# include "vpi_priv.h"
# include "vthread.h"
# include "schedule.h"
# include "ivl_alloc.h"
# include <cstdio>
# include <cctype>
#ifdef USE_READLINE
@ -39,6 +38,7 @@
#endif
# include <cstring>
# include <cstdlib>
# include "ivl_alloc.h"
struct __vpiScope*stop_current_scope = 0;
bool stop_is_finish; /* When set, $stop acts like $finish (set in main.cc). */

View File

@ -25,15 +25,15 @@
#include "symbols.h"
#include "compile.h"
#include "config.h"
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#include "ivl_alloc.h"
#endif
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <iostream>
#ifdef CHECK_WITH_VALGRIND
#include "vvp_cleanup.h"
#include "ivl_alloc.h"
#endif
// We may need these later when we build the VPI interface to
// UDP definitions.

View File

@ -23,11 +23,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
static int string_get(int code, vpiHandle ref)
{

View File

@ -19,11 +19,11 @@
# include "compile.h"
# include "vpi_priv.h"
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
static int named_event_get(int code, vpiHandle ref)
{

View File

@ -22,9 +22,9 @@
*/
# include "vpi_priv.h"
# include "ivl_alloc.h"
# include <cstdlib>
# include <cassert>
# include "ivl_alloc.h"
static int iterator_free_object(vpiHandle ref)
{

View File

@ -22,12 +22,12 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cassert>
# include <cstdarg>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include "ivl_alloc.h"
extern FILE* vpi_trace;

View File

@ -21,11 +21,11 @@
# include "vpi_priv.h"
# include "ivl_dlfcn.h"
# include "vvp_cleanup.h"
# include "ivl_alloc.h"
# include <cstdio>
# include <cstring>
# include <sys/types.h>
# include <sys/stat.h>
# include "ivl_alloc.h"
static ivl_dll_t*dll_list = 0;
static unsigned dll_list_cnt = 0;

View File

@ -24,11 +24,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
struct __vpiRealVar* vpip_realvar_from_handle(vpiHandle obj)
{

View File

@ -25,10 +25,10 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstring>
# include <cstdlib>
# include <cassert>
# include "ivl_alloc.h"
static vpiHandle *vpip_root_table_ptr = 0;
static unsigned vpip_root_table_cnt = 0;

View File

@ -31,7 +31,6 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cmath>
# include <iostream>
# include <cstdio>
@ -42,6 +41,7 @@
#ifdef CHECK_WITH_VALGRIND
# include <valgrind/memcheck.h>
#endif
# include "ivl_alloc.h"
/*
* Hex digits that represent 4-value bits of Verilog are not as

View File

@ -29,11 +29,11 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cassert>
# include "ivl_alloc.h"
static const struct __vpirt vpip_systf_def_rt = {
vpiUserSystf,

View File

@ -30,10 +30,10 @@
# include "vvp_cleanup.h"
# include <map>
#endif
# include "ivl_alloc.h"
# include <cstdio>
# include <cstdlib>
# include <cassert>
# include "ivl_alloc.h"
struct __vpiVThrVec {
struct __vpiHandle base;

View File

@ -23,13 +23,13 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <cstdio>
# include <cstring>
# include <climits> /* for CHAR_BIT */
# include <cstdlib>
# include <cctype>
# include <cassert>
# include "ivl_alloc.h"
/* If you are allergic to malloc, you can set a stack memory allocation
* here. Otherwise, malloc() is used for the temporary array, so the

View File

@ -25,12 +25,12 @@
#ifdef CHECK_WITH_VALGRIND
# include "vvp_cleanup.h"
#endif
# include "ivl_alloc.h"
# include <iostream>
# include <list>
# include <cassert>
# include <cstdlib>
# include <cstring>
# include "ivl_alloc.h"
static bool at_EOS = false;

View File

@ -23,7 +23,6 @@
# include "vpi_user.h"
# include "vvp_vpi_callback.h"
# include "permaheap.h"
# include "ivl_alloc.h"
# include <cstddef>
# include <cstdlib>
# include <cstring>
@ -36,6 +35,8 @@
class ostream;
#endif
# include "ivl_alloc.h"
using namespace std;
@ -334,12 +335,12 @@ inline vvp_vector4_t::vvp_vector4_t(unsigned size__, vvp_bit4_t val)
: size_(size__)
{
/* note: this relies on the bit encoding for the vvp_bit4_t. */
const static unsigned long init_atable[4] = {
static const unsigned long init_atable[4] = {
WORD_0_ABITS,
WORD_1_ABITS,
WORD_Z_ABITS,
WORD_X_ABITS };
const static unsigned long init_btable[4] = {
static const unsigned long init_btable[4] = {
WORD_0_BBITS,
WORD_1_BBITS,
WORD_Z_BBITS,
@ -1646,4 +1647,11 @@ inline bool vvp_net_fil_t::test_force_mask_is_zero(void) const
return false;
}
/*
* Undefine the ivl_alloc.h definitions so they don't leak out of this file.
*/
#undef malloc
#undef realloc
#undef calloc
#endif