avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From moriarty <...@git.apache.org>
Subject [GitHub] avro pull request #142: AVRO-1936: C++: adds new include guards
Date Mon, 24 Oct 2016 17:23:18 GMT
GitHub user moriarty reopened a pull request:

    https://github.com/apache/avro/pull/142

    AVRO-1936: C++: adds new include guards

    This change adds additional include guards in a different format.
    https://issues.apache.org/jira/browse/AVRO-1936
    
    Removes the random numbers from the include guards, instead guarding
    only by NAMESPACE_TYPE_ where TYPE is the Enum, Record or Union Type.
    
    Adds #ifndef NAMESPACE_TYPE_... checks before each struct declaration.
    
    Adds #define NAMESPACE_TYPE_... to the generate(Enum/Record/Union)Traits
    funtion.
    
    This allows including multiple of the generated C++ files into one
    source C++ file, where the avsc files were generated from avdl, and the
    avdl files contained includes with shared basic types.
    
    The previous way to achieve this, as was done in the AvrogencppTests,
    was to abuse or take advantage adding additional meaningless namespaces.
    
    This doesn't fail the existing AvrogencppTests, but I would like input from avro-cpp users
how they've gotten around this and if this breaks anything.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/moriarty/avro avro-1936/cpp-include-guards-enhancement/dev

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/142.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #142
    
----
commit 92549ed69c56e2f393c361143c3b8ee90e05d538
Author: Alexander Moriarty <alexander.moriarty@tba.nl>
Date:   2016-10-24T11:59:19Z

    AVRO-1936: C++: adds new include guards
    
    This change adds additional include guards in a different format.
    
    Removes the random numbers from the include guards, instead guarding
    only by NAMESPACE_TYPE_ where TYPE is the Enum, Record or Union Type.
    
    Adds #ifndef NAMESPACE_TYPE_... checks before each struct declaration.
    
    Adds #define NAMESPACE_TYPE_... to the generate(Enum/Record/Union)Traits
    funtion.
    
    This allows including multiple of the generated C++ files into one
    source C++ file, where the avsc files were generated from avdl, and the
    avdl files contained includes with shared basic types.
    
    The previous way to achieve this, as was done in the AvrogencppTests,
    was to abuse or take advantage adding additional meaningless namespaces.
    
    I have left one line of Commented out Code for input from avro-cpp
    users on this proposal.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message