tzaeschke / phtree-cpp

PH-Tree C++ implementation
Apache License 2.0
29 stars 9 forks source link

Consider renaming of template type name CALLBACK #142

Closed arasatalar closed 1 year ago

arasatalar commented 1 year ago

Windows SDK defines "CALLBACK" macro and it leads to compilation errors when used as template type names.
I propose a simple renaming and attach the patch (only a small part of it) to clarify what I mean. Thanks..

diff --git a/include/phtree/phtree.h b/include/phtree/phtree.h index 7a418d4..a1516d9 100644 --- a/include/phtree/phtree.h +++ b/include/phtree/phtree.h @@ -240,9 +240,9 @@ class PhTree {

tzaeschke commented 1 year ago

Thanks for reporting. I'll have a look.

tzaeschke commented 1 year ago

Could you try out this branch? https://github.com/tzaeschke/phtree-cpp/tree/fix/142-rename-callback-parameter

tzaeschke commented 1 year ago

It seems to work now, but in addition you have to either #define NOMINMAX, or as preprocessor option with /DNOMINMAX, or #include "phtree/phtree.h" before including windows SDK headers.

arasatalar commented 1 year ago

Thanks, quick you are. I will try it soon (already tried a very similar one and worked so should be ok).

And for the the NOMINMAX issue, we already added the preprocessor flag to resolve the issue some time ago. Thanks for the info.

arasatalar commented 1 year ago

Checked it, seems perfect.. Thanks for the quick response. Best

tzaeschke commented 1 year ago

@arasatalar Thanks!