RTimothyEdwards / netgen

Netgen complete LVS tool for comparing SPICE or verilog netlists
Other
109 stars 25 forks source link

fix wrong 'hash' being linked in + C99 compat #39

Closed kammoh closed 3 years ago

kammoh commented 3 years ago

This PR fixes crash on macOS due to wrong hash() being linked in.

It also contains some cleanup to make sure proper function definitions are declared and available (as required by C99) to - make compile possible in newer compilers (e.g.Apple clang)

I still had to rename hash() to my_hash() to prevent the wrong linkage happening, but I as far as I can tell this function is not part of the API and the renaming should not really affect anything.

kammoh commented 3 years ago

<xlocale.h> was absolutely not needed. extern keyword is superfluous for functions. The reason I removed it was that I suspected it could be confusing my compiler leading to the wrong hash() being linked in. I personally find the version without extern cleaner, but I can revert it.

kammoh commented 3 years ago

There's some discussion about the extern keyword here: https://stackoverflow.com/a/56202586/1308473

RTimothyEdwards commented 3 years ago

Languages are full of words that serve no syntactical purpose, but provide context and declare intent.

RTimothyEdwards commented 3 years ago

Pulled and merged, to opencircuitdesign.com. The github repository mirror will update automatically overnight.