njpipeorgan / wll-interface

Header only C++ library simplifying Wolfram LibraryLink code
MIT License
38 stars 5 forks source link

update conditional compilation to support Apple `clang` #4

Closed samuelpmish closed 1 year ago

samuelpmish commented 1 year ago

First of all: thanks for writing this! I've been interested in adding Mathematica bindings to a C++ library of mine for a while, and this project has been incredibly helpful.

On my mac, Apple clang 14.0.3 seems to define __GNUC__ with some weird value that makes it fail the static_assertion here https://github.com/njpipeorgan/wll-interface/blob/82e871944a981b8f03a30a0c302ec0e29a9e9698/include/wll_interface.h#L31-L33

So this PR just rearranges the conditionals a bit to make it the __clang__ check come first to avoid this problem. It's been tested on a mac with Apple Clang 14.0.3, and on an Ubuntu machine with gcc (10, 11, 12) and clang (11 - 16).