C++ compatibility

21 views
Skip to first unread message

Pavel Odintsov

unread,
Jul 10, 2017, 6:47:21 PM7/10/17
to libcmime-devel
Hello, guys!

As I understand, you have support for C++ but recently I hit issue with g++ compiler 6.2.0.

In file included from /opt/fastnetmon/libraries/libcmime_0_2_0/include/cmime/cmime_message.h:60:0,
                 from /home/odintsov/fastnetmon/src/fast_library.cpp:21:
/opt/fastnetmon/libraries/libcmime_0_2_0/include/cmime/cmime_list.h:160:57: error: expected ‘,’ or ‘...’ before ‘new’
 int cmime_list_map_new(CMimeList_T *list, CMimeList_T **new, void *(*func)(CMimeListElem_T *elem, void *args), void *args);
                                                         ^~~

I fixed it by adding following lines at top of libcmime_0_2_0/include/cmime/cmime_list.h:
#define new new__ 

And another one to the end of same file:
#undef new

Could you replace "new" variable name by something else here to avoid such conflicts? 

Thank you! 

Axel Steiner

unread,
Jul 11, 2017, 2:57:30 AM7/11/17
to libcmim...@googlegroups.com
Hi,
thank you for the hint. I’ve replaced the variable name and released a fixed version 0.2.1.

Bye,
Axel
Reply all
Reply to author
Forward
0 new messages