incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marvin Humphrey (JIRA)" <>
Subject [jira] Updated: (LUCY-79) Compile in C++ mode for MSVC
Date Tue, 01 Dec 2009 22:47:20 GMT


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:

-    char *command = malloc(command_max_size);
+    char *command = (char*)malloc(command_max_size);

Second, protecting headers so that C++ doesn't mangle global symbol names:

+#ifdef __cplusplus
+extern "C" {
 #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
+#ifdef __cplusplus
 #endif /* H_CHAZ_HEAD_CHECK */

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:
>             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.

View raw message