NOAA-EMC / NCEPLIBS-bacio

This library performs binary I/O for the NCEP models.
Other
2 stars 6 forks source link

byteswap.c has system pre-processor define code, but always sets LINUX anyway... #56

Closed edwardhartnett closed 2 years ago

edwardhartnett commented 2 years ago

In byteswap.c we have code like this:

#ifdef LINUX
  void byteswap_
         (char *data, int *nbyte, int *nnum) {
#endif
#ifdef IBM4
  void byteswap
         (char *data, int *nbyte, int *nnum) {
#endif
#ifdef IBM8
  void byteswap
         (char *data, long long int *nbyte, long long int *nnum) {
#endif

But we also have this at the top of the file:

#define LINUX /**< Define LINUX. */

So LINUX is the only one we need...

kgerheiser commented 2 years ago

Yeah, there's no reason to have these IBM (and AIX) macros. iso_c_binding is the correct way to interface with C so you don't have to play with name mangling manually.

edwardhartnett commented 2 years ago

Yes, we should be using the modern Fortran/C API. See #34.