uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.83k stars 459 forks source link

PloygonAlgos - Throws error when used wrapper library in swift #771

Open warmachinesocial opened 1 year ago

warmachinesocial commented 1 year ago

I don't know who's fault is this, I'm currently creating a binding for swift to use the library. However it couldn't build as it threw an error. Below is the list of macros that were throwing the error.

`#ifndef TYPE

error "TYPE must be defined before including this header"

endif

ifndef IS_EMPTY

error "IS_EMPTY must be defined before including this header"

endif

ifndef INIT_ITERATION

error "INIT_ITERATION must be defined before including this header"

endif

ifndef ITERATE

error "ITERATE must be defined before including this header"

endif`

Screenshot 2023-06-13 at 7 07 00 PM

warmachinesocial commented 1 year ago

I was searching for TYPE in the project but couldn't find it?

nrabinowitz commented 1 year ago

The TYPE is defined in linkedGeo.c and polygon.c - the idea is that the macros allow the code in polygonAlgos.h to be polymorphic in a way that's otherwise difficult in C. You shouldn't be including polygonAlgos.h directly - it's included in these two files.