diff --git a/ivl_target.h b/ivl_target.h index 6bd0dc66b..33e3d6307 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -1,7 +1,7 @@ #ifndef __ivl_target_H #define __ivl_target_H /* - * Copyright (c) 2000-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -158,7 +158,15 @@ typedef struct ivl_array_s *ivl_array_t; typedef struct ivl_branch_s *ivl_branch_t; typedef struct ivl_delaypath_s*ivl_delaypath_t; typedef struct ivl_design_s *ivl_design_t; +/* clang++ wants this to be class to match the definition, but clang + * (the C) compiler needs it to be a struct since class is not defined + * in C. They are effecively both pointers to an object so everything + * works out. */ +#ifdef __cplusplus +typedef class ivl_discipline_s*ivl_discipline_t; +#else typedef struct ivl_discipline_s*ivl_discipline_t; +#endif typedef struct ivl_event_s *ivl_event_t; typedef struct ivl_expr_s *ivl_expr_t; typedef struct ivl_island_s *ivl_island_t; @@ -167,7 +175,12 @@ typedef struct ivl_lval_s *ivl_lval_t; typedef struct ivl_net_const_s*ivl_net_const_t; typedef struct ivl_net_logic_s*ivl_net_logic_t; typedef struct ivl_udp_s *ivl_udp_t; +/* See the comments above. */ +#ifdef __cplusplus +typedef class ivl_nature_s *ivl_nature_t; +#else typedef struct ivl_nature_s *ivl_nature_t; +#endif typedef struct ivl_net_probe_s*ivl_net_probe_t; typedef struct ivl_nexus_s *ivl_nexus_t; typedef struct ivl_nexus_ptr_s*ivl_nexus_ptr_t; diff --git a/vvp/codes.h b/vvp/codes.h index 04de9b7f4..20946b4c8 100644 --- a/vvp/codes.h +++ b/vvp/codes.h @@ -1,7 +1,7 @@ #ifndef __codes_H #define __codes_H /* - * Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -184,7 +184,7 @@ struct vvp_code_s { uint32_t bit_idx[2]; vvp_net_t *net2; vvp_code_t cptr2; - struct ufunc_core*ufunc_core_ptr; + class ufunc_core*ufunc_core_ptr; }; }; diff --git a/vvp/compile.cc b/vvp/compile.cc index b34e0f39b..8c129bdb1 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -325,14 +325,14 @@ vvp_net_t* vvp_net_lookup(const char*label) * this call is its last chance. If it cannot complete the operation, * it must print an error message and return false. */ -static struct resolv_list_s*resolv_list = 0; +static class resolv_list_s*resolv_list = 0; resolv_list_s::~resolv_list_s() { free(label_); } -void resolv_submit(struct resolv_list_s*cur) +void resolv_submit(class resolv_list_s*cur) { if (cur->resolve()) { delete cur; @@ -613,13 +613,13 @@ void compile_cleanup(void) } do { - struct resolv_list_s *res = resolv_list; + class resolv_list_s *res = resolv_list; resolv_list = 0x0; last = nerrs == lnerrs; lnerrs = nerrs; nerrs = 0; while (res) { - struct resolv_list_s *cur = res; + class resolv_list_s *cur = res; res = res->next; if (cur->resolve(last)) delete cur; diff --git a/vvp/compile.h b/vvp/compile.h index 7b44405c4..78a91c1d7 100644 --- a/vvp/compile.h +++ b/vvp/compile.h @@ -1,7 +1,7 @@ #ifndef __compile_H #define __compile_H /* - * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -196,7 +196,7 @@ extern void compile_dff(char*label, struct symb_s arg_e, struct symb_s arg_a); -class __vpiModPath; +struct __vpiModPath; extern __vpiModPath* compile_modpath(char*label, struct symb_s drv, struct symb_s dest); @@ -277,11 +277,11 @@ class resolv_list_s { const char*label() const { return label_; } private: - friend void resolv_submit(struct resolv_list_s*cur); + friend void resolv_submit(class resolv_list_s*cur); friend void compile_cleanup(void); char*label_; - struct resolv_list_s*next; + class resolv_list_s*next; }; /* diff --git a/vvp/schedule.cc b/vvp/schedule.cc index 505cb713b..7b2ea2521 100644 --- a/vvp/schedule.cc +++ b/vvp/schedule.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -163,9 +163,9 @@ inline void* assign_vector4_event_s::operator new(size_t size) return assign4_heap.alloc_slab(); } -void assign_vector4_event_s::operator delete(void*ptr) +void assign_vector4_event_s::operator delete(void*dptr) { - assign4_heap.free_slab(ptr); + assign4_heap.free_slab(dptr); } unsigned long count_assign4_pool(void) { return assign4_heap.pool; } @@ -194,9 +194,9 @@ inline void* assign_vector8_event_s::operator new(size_t size) return assign8_heap.alloc_slab(); } -void assign_vector8_event_s::operator delete(void*ptr) +void assign_vector8_event_s::operator delete(void*dptr) { - assign8_heap.free_slab(ptr); + assign8_heap.free_slab(dptr); } unsigned long count_assign8_pool() { return assign8_heap.pool; } @@ -225,9 +225,9 @@ inline void* assign_real_event_s::operator new (size_t size) return assignr_heap.alloc_slab(); } -void assign_real_event_s::operator delete(void*ptr) +void assign_real_event_s::operator delete(void*dptr) { - assignr_heap.free_slab(ptr); + assignr_heap.free_slab(dptr); } unsigned long count_assign_real_pool(void) { return assignr_heap.pool; } diff --git a/vvp/vpi_priv.h b/vvp/vpi_priv.h index a3a40653a..fdb15e01a 100644 --- a/vvp/vpi_priv.h +++ b/vvp/vpi_priv.h @@ -1,7 +1,7 @@ #ifndef __vpi_priv_H #define __vpi_priv_H /* - * Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -425,7 +425,7 @@ struct __vpiSysTaskCall { /* These represent where in the vthread to put the return value. */ unsigned vbit; signed vwid; - class vvp_net_t*fnet; + struct vvp_net_t*fnet; unsigned file_idx; unsigned lineno; bool put_value; @@ -528,7 +528,7 @@ extern unsigned vpip_module_path_cnt; */ extern vpiHandle vpip_build_vpi_call(const char*name, unsigned vbit, int vwid, - class vvp_net_t*fnet, + struct vvp_net_t*fnet, unsigned argc, vpiHandle*argv, long file_idx, diff --git a/vvp/vpi_tasks.cc b/vvp/vpi_tasks.cc index 58b09037b..57ab3bb16 100644 --- a/vvp/vpi_tasks.cc +++ b/vvp/vpi_tasks.cc @@ -634,7 +634,7 @@ static void cleanup_vpi_call_args(unsigned argc, vpiHandle*argv) * vbit is also a non-zero value, the address in thread space of the result. */ vpiHandle vpip_build_vpi_call(const char*name, unsigned vbit, int vwid, - class vvp_net_t*fnet, + struct vvp_net_t*fnet, unsigned argc, vpiHandle*argv, long file_idx, long lineno) { diff --git a/vvp/vvp_island.h b/vvp/vvp_island.h index dd5dddfe0..5fb8c2ba0 100644 --- a/vvp/vvp_island.h +++ b/vvp/vvp_island.h @@ -1,7 +1,7 @@ #ifndef __vvp_island_H #define __vvp_island_H /* - * Copyright (c) 2008,2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2008-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -53,7 +53,7 @@ * branches of analog within the island. */ -class vvp_island_branch; +struct vvp_island_branch; class vvp_island_node; class vvp_island : private vvp_gen_event_s { diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index c2976bec5..0ef7805fd 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -1,7 +1,7 @@ #ifndef __vvp_net_H #define __vvp_net_H /* - * Copyright (c) 2004-2009 Stephen Williams (steve@icarus.com) + * Copyright (c) 2004-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -40,7 +40,7 @@ using namespace std; class vvp_scalar_t; /* Basic netlist types. */ -class vvp_net_t; +struct vvp_net_t; class vvp_net_fun_t; /* Core net function types. */ @@ -1220,10 +1220,10 @@ class vvp_vpi_callback_wordable : public vvp_vpi_callback { ~vvp_vpi_callback_wordable(); void run_vpi_callbacks(); - void attach_as_word(class __vpiArray* arr, unsigned long addr); + void attach_as_word(struct __vpiArray* arr, unsigned long addr); private: - class __vpiArray* array_; + struct __vpiArray* array_; unsigned long array_word_; };