Clean up MCS/GNU portability hacks in header files.
This commit is contained in:
parent
d766e82aa1
commit
64b72cf7e1
32
ivl_target.h
32
ivl_target.h
|
|
@ -41,6 +41,12 @@
|
||||||
# define __attribute__(x)
|
# define __attribute__(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||||
|
# define ENUM_UNSIGNED_INT : unsigned int
|
||||||
|
#else
|
||||||
|
# define ENUM_UNSIGNED_INT
|
||||||
|
#endif
|
||||||
|
|
||||||
_BEGIN_DECL
|
_BEGIN_DECL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -201,11 +207,7 @@ typedef enum ivl_dis_domain_e {
|
||||||
IVL_DIS_CONTINUOUS = 2
|
IVL_DIS_CONTINUOUS = 2
|
||||||
} ivl_dis_domain_t;
|
} ivl_dis_domain_t;
|
||||||
|
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
typedef enum ivl_drive_e ENUM_UNSIGNED_INT {
|
||||||
typedef enum ivl_drive_e : unsigned int {
|
|
||||||
#else
|
|
||||||
typedef enum ivl_drive_e {
|
|
||||||
#endif
|
|
||||||
IVL_DR_HiZ = 0,
|
IVL_DR_HiZ = 0,
|
||||||
IVL_DR_SMALL = 1,
|
IVL_DR_SMALL = 1,
|
||||||
IVL_DR_MEDIUM = 2,
|
IVL_DR_MEDIUM = 2,
|
||||||
|
|
@ -247,11 +249,7 @@ typedef enum ivl_expr_type_e {
|
||||||
IVL_EX_UNARY = 14
|
IVL_EX_UNARY = 14
|
||||||
} ivl_expr_type_t;
|
} ivl_expr_type_t;
|
||||||
|
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
typedef enum ivl_select_type_e ENUM_UNSIGNED_INT {
|
||||||
typedef enum ivl_select_type_e : unsigned int {
|
|
||||||
#else
|
|
||||||
typedef enum ivl_select_type_e {
|
|
||||||
#endif
|
|
||||||
IVL_SEL_OTHER = 0,
|
IVL_SEL_OTHER = 0,
|
||||||
IVL_SEL_IDX_UP = 1,
|
IVL_SEL_IDX_UP = 1,
|
||||||
IVL_SEL_IDX_DOWN = 2
|
IVL_SEL_IDX_DOWN = 2
|
||||||
|
|
@ -353,11 +351,7 @@ typedef enum ivl_path_edge_e {
|
||||||
|
|
||||||
/* Processes are initial, always, or final blocks with a statement. This is
|
/* Processes are initial, always, or final blocks with a statement. This is
|
||||||
the type of the ivl_process_t object. */
|
the type of the ivl_process_t object. */
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
typedef enum ivl_process_type_e ENUM_UNSIGNED_INT {
|
||||||
typedef enum ivl_process_type_e : unsigned int {
|
|
||||||
#else
|
|
||||||
typedef enum ivl_process_type_e {
|
|
||||||
#endif
|
|
||||||
IVL_PR_INITIAL = 0,
|
IVL_PR_INITIAL = 0,
|
||||||
IVL_PR_ALWAYS = 1,
|
IVL_PR_ALWAYS = 1,
|
||||||
IVL_PR_FINAL = 2
|
IVL_PR_FINAL = 2
|
||||||
|
|
@ -443,11 +437,7 @@ typedef enum ivl_sfunc_as_task_e {
|
||||||
|
|
||||||
/* This is the type of a variable, and also used as the type for an
|
/* This is the type of a variable, and also used as the type for an
|
||||||
expression. */
|
expression. */
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
typedef enum ivl_variable_type_e ENUM_UNSIGNED_INT {
|
||||||
typedef enum ivl_variable_type_e : unsigned int {
|
|
||||||
#else
|
|
||||||
typedef enum ivl_variable_type_e {
|
|
||||||
#endif
|
|
||||||
IVL_VT_VOID = 0, /* Not used */
|
IVL_VT_VOID = 0, /* Not used */
|
||||||
IVL_VT_NO_TYPE = 1, /* Place holder for missing/unknown type. */
|
IVL_VT_NO_TYPE = 1, /* Place holder for missing/unknown type. */
|
||||||
IVL_VT_REAL = 2,
|
IVL_VT_REAL = 2,
|
||||||
|
|
@ -2359,4 +2349,6 @@ typedef const char* (*target_query_f) (const char*key);
|
||||||
|
|
||||||
_END_DECL
|
_END_DECL
|
||||||
|
|
||||||
|
#undef ENUM_UNSIGNED_INT
|
||||||
|
|
||||||
#endif /* IVL_ivl_target_H */
|
#endif /* IVL_ivl_target_H */
|
||||||
|
|
|
||||||
26
netlist.h
26
netlist.h
|
|
@ -90,6 +90,12 @@ class netvector_t;
|
||||||
struct target;
|
struct target;
|
||||||
struct functor_t;
|
struct functor_t;
|
||||||
|
|
||||||
|
#if defined(__cplusplus) && defined(_MSC_VER)
|
||||||
|
# define ENUM_UNSIGNED_INT : unsigned int
|
||||||
|
#else
|
||||||
|
# define ENUM_UNSIGNED_INT
|
||||||
|
#endif
|
||||||
|
|
||||||
ostream& operator << (ostream&o, ivl_variable_type_t val);
|
ostream& operator << (ostream&o, ivl_variable_type_t val);
|
||||||
|
|
||||||
extern void join_island(NetPins*obj);
|
extern void join_island(NetPins*obj);
|
||||||
|
|
@ -102,12 +108,7 @@ class Link {
|
||||||
friend class NexusSet;
|
friend class NexusSet;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
enum DIR ENUM_UNSIGNED_INT { PASSIVE, INPUT, OUTPUT };
|
||||||
enum DIR : unsigned int { PASSIVE, INPUT, OUTPUT };
|
|
||||||
#else
|
|
||||||
enum DIR { PASSIVE, INPUT, OUTPUT };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private: // Only NetPins can create/delete Link objects
|
private: // Only NetPins can create/delete Link objects
|
||||||
Link();
|
Link();
|
||||||
~Link();
|
~Link();
|
||||||
|
|
@ -623,11 +624,7 @@ class NetDelaySrc : public NetObj {
|
||||||
class PortType
|
class PortType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
enum Enum ENUM_UNSIGNED_INT { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT, PREF };
|
||||||
enum Enum : unsigned int { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT, PREF };
|
|
||||||
#else
|
|
||||||
enum Enum { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT, PREF };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Merge Port types (used to construct a sane combined port-type
|
* Merge Port types (used to construct a sane combined port-type
|
||||||
|
|
@ -655,11 +652,7 @@ struct PortInfo
|
||||||
class NetNet : public NetObj, public PortType {
|
class NetNet : public NetObj, public PortType {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#if defined(__cplusplus) && !defined(__GNUC__)
|
enum Type ENUM_UNSIGNED_INT { NONE, IMPLICIT, IMPLICIT_REG, INTEGER, WIRE, TRI, TRI1,
|
||||||
enum Type : unsigned int { NONE, IMPLICIT, IMPLICIT_REG, INTEGER, WIRE, TRI, TRI1,
|
|
||||||
#else
|
|
||||||
enum Type { NONE, IMPLICIT, IMPLICIT_REG, INTEGER, WIRE, TRI, TRI1,
|
|
||||||
#endif
|
|
||||||
SUPPLY0, SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG,
|
SUPPLY0, SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG,
|
||||||
UNRESOLVED_WIRE };
|
UNRESOLVED_WIRE };
|
||||||
|
|
||||||
|
|
@ -5017,4 +5010,5 @@ inline unsigned Link::get_pin() const
|
||||||
return pin_;
|
return pin_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef ENUM_UNSIGNED_INT
|
||||||
#endif /* IVL_netlist_H */
|
#endif /* IVL_netlist_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue