ellzey/libevhtp — Issue #22: C++/clang++ compatibility
Author: ahochhaus
Created: 2011-12-27 18:44:35+00:00
State: open

It would be nice if libevhtp could be used "out of the box" from C++ code. As best I can tell, only three minor changes are required:

* Define enums prior to referencing them in typedefs. [1]
* Expose API via extern "C".
* Change "#define _GNU_SOURCE" in evthr.h to "#define _GNU_SOURCE 1". [2]

I will send a pull request shortly. Thanks.

[1] To avoid errors like:

```In file included from ../../third_party/libevhtp/upstream/evhtp.h:5:
../../third_party/libevhtp/upstream/evthr/evthr.h:18:14: error: ISO C++ forbids forward references to 'enum' types
typedef enum evthr_res evthr_res;
^
1 error generated.
```

[2] To avoid:

```In file included from ../../third_party/libevhtp/upstream/evhtp.h:5:
../../third_party/libevhtp/upstream/evthr/evthr.h:1:9: error: '_GNU_SOURCE' macro redefined [-Werror]
#define _GNU_SOURCE
^
:136:9: note: previous definition is here
#define _GNU_SOURCE 1
^
1 error generated.
```