sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.6k stars 347 forks source link

[BUG] DragonFlyBSD has 'struct tls' #455

Closed movepointsolutions closed 1 year ago

movepointsolutions commented 1 year ago

Describe the bug DragonFlyBSD has 'struct tls' declared in standard headers, so test binary does not compile. /usr/local/include/tls.h:82:8: note: forward declaration of 'struct tls' struct tls; ^~~ In file included from /home/anek/movepoint.ru/redis-plus-plus/test/../src/sw/redis++/connection_pool.h:27, from /home/anek/movepoint.ru/redis-plus-plus/test/../src/sw/redis++/redis.h:25, from /home/anek/movepoint.ru/redis-plus-plus/test/../src/sw/redis++/redis++.h:20, from /home/anek/movepoint.ru/redis-plus-plus/test/src/sw/redis++/test_main.cpp:32: /home/anek/movepoint.ru/redis-plus-plus/test/../src/sw/redis++/sentinel.h:51:10: error: invalid use of incomplete type 'struct tls' tls::TlsOptions tls; ^~~~~~

To Reproduce try to compile at fresh DragonFlyBSD

Expected behavior I would like to see it building OK

Environment:

Additional context I am myself new to BSD, used Debian/Arch Linux mainly in production, but currently have DragonFlyBSD server

movepointsolutions commented 1 year ago

It would be nice if C++ had smth like explicit namespace declaration which would shadow priorly declared types in favor of namespace

sewenew commented 1 year ago

Looks like it's a problem that header files conflict, i.e. both redis-plus-plus and the standard header have a tls.h file. I was plan to include headers with path, e.g. including xx/xx/tls.h, instead of tls.h. However, it's a big project. I'll let you know, when I get some progress.

Regards

movepointsolutions commented 1 year ago

With quote syntax "tls.h", don't -I and dot(current .cpp file dir) paths have precedence over system libc(whatever) path? I thought that the problem is in including both, as system tls.h could be included from any, even std

.

sewenew commented 1 year ago

I've included path for headers, and the problem should be fixed. However, I don't have a DragonFlyBSD env, and cannot reproduce the problem. Please try the latest code on master branch to see if the problem has been fixed.

Sorry for the late reply. Too busy these days.

Regards

movepointsolutions commented 1 year ago

Hi :) I've successfully built the library, so I close the issue, don't currently have root access to the machine, so can't install Redis and run the tests, but will make sure they are OK and my code works, so thanks, hola la biznas :)