[rabbitmq-discuss] librabbitmq strdup patch

Daniel Schauenberg d at unwiredcouch.com
Wed Feb 2 10:50:34 GMT 2011


I need to interact with a message queue from C++ in a project of mine and want to use RabbitMQ for it. However I did not find a suitable C++ client so I started using librabbitmq. It didn't compile for me on OSX and FreeBSD as strdup is already defined on these platforms. So I patched it to use the librabbitmq strdup definition only if there doesn't already exist one and moved the strdup code into a single .h file.

I submitted a pull request on github (https://github.com/rabbitmq/rabbitmq-c/pull/1). As I am not a C programmer, I'd love some input on this (especially if there is a more suitable #define to check for).


More information about the rabbitmq-discuss mailing list