Make joanne fix for SPICE_DATA preprocessor macro comparison apply for unix as well

This commit is contained in:
stefan schippers 2023-02-27 22:32:28 +01:00
parent c908c77351
commit dbc123e8cc
3 changed files with 11 additions and 3 deletions

View File

@ -189,6 +189,9 @@
<Component Id="CMPSRCXSCHEMTCL">
<File Id="XSCHEMTCL" KeyPath="yes" Source="../../src/xschem.tcl" />
</Component>
<Component Id="CMPSRCCREATEGRAPHMTCL">
<File Id="CREATEGRAPHMTCL" KeyPath="yes" Source="../../src/create_graph.tcl" />
</Component>
<Component Id="CMPMAKESCHFROMVHDLAWK">
<File Id="MAKESCHFROMVHDLAWK" KeyPath="yes" Source="../../src/make_sch_from_vhdl.awk" />
</Component>
@ -310,6 +313,7 @@
<Fragment>
<ComponentGroup Id="src">
<ComponentRef Id="CMPSRCXSCHEMTCL" />
<ComponentRef Id="CMPSRCCREATEGRAPHMTCL" />
<ComponentRef Id="CMPSRCXSCHEMRC" />
</ComponentGroup>
<ComponentGroup Id="share">

View File

@ -808,7 +808,11 @@ int table_read(const char *f)
prev_prev_empty = prev_empty = 0;
line_ptr = line;
field = 0;
#ifdef __unix__
while( (line_tok = strtok_r(line_ptr, " \t\n", &line_save)) ) {
#else
while( (line_tok = my_strtok_r(line_ptr, " \t\n", "", &line_save)) ) {
#endif
line_ptr = NULL;
/* dbg(1,"%s ", line_tok); */
if(nline == 0) { /* header line */
@ -819,12 +823,11 @@ int table_read(const char *f)
xctx->graph_nvars = field + 1;
} else { /* data line */
if(field >= xctx->graph_nvars) break;
#if SPICE_DATA == float
#if SPICE_DATA_TYPE == 1 /* float */
xctx->graph_values[field][npoints] = (SPICE_DATA)my_atof(line_tok);
#else
#else /* double */
xctx->graph_values[field][npoints] = (SPICE_DATA)my_atod(line_tok);
#endif
}
++field;
}

View File

@ -377,6 +377,7 @@ do { \
/* set do double if you need more precision at the expense of memory */
#define SPICE_DATA float
#define SPICE_DATA_TYPE 1 /* Use 1 for float, 2 for double */
#define DIG_NWAVES 0.1 /* inverse number: by default 10 digital traces per graph */
#define DIG_SPACE 0.07 /* trace extends from 0 to DIG_SPACE, so we have DIG_WAVES-DIG_SPACE
* spacing between traces */