[
https://issues.apache.org/jira/browse/LUCY-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marvin Humphrey updated LUCY-79:
--------------------------------
Attachment: cplusplus.patch
Two types of changes make up the bulk of this patch:
First, adding casts to void* assignments:
{code:none}
- char *command = malloc(command_max_size);
+ char *command = (char*)malloc(command_max_size);
{code}
Second, protecting headers so that C++ doesn't mangle global symbol names:
{code:none}
#define H_CHAZ_HEAD_CHECK
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "Charmonizer/Core/Defines.h"
/* Bootstrap the HeadCheck. Call this before anything else.
@@ -36,6 +40,10 @@
#define HeadCheck_check_many_headers chaz_HeadCheck_check_many_headers
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* H_CHAZ_HEAD_CHECK */
{code}
Other casts have been added as well because C++ is more finicky than C with
regards
to typing. For instance, an invalid comparison of a pointer to -1 rather than
NULL (within
Charmonizer's LargeFiles module) outright failed to compile. In this regard,
adding C++
as a build target is useful regardless of whether we open up Lucy's C syntax
constraints.
> Compile in C++ mode for MSVC
> ----------------------------
>
> Key: LUCY-79
> URL: https://issues.apache.org/jira/browse/LUCY-79
> Project: Lucy
> Issue Type: Improvement
> Components: Boilerplater, Charmonizer, Core, Perl bindings
> Reporter: Marvin Humphrey
> Assignee: Marvin Humphrey
> Attachments: cplusplus.patch
>
>
> Adapt the code base so that Lucy compiles and passes tests under C++,
> using both g++ and MSVC. Continue to prefer gcc to g++, but switch MSVC
> to compile in C++ mode by default.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.