You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by moriarty <gi...@git.apache.org> on 2016/10/24 12:20:19 UTC

[GitHub] avro pull request #142: AVRO-1936: C++: adds new include guards

GitHub user moriarty opened 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 <al...@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.
---

[GitHub] avro pull request #142: AVRO-1936: C++: adds new include guards

Posted by moriarty <gi...@git.apache.org>.
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 <al...@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.
---

[GitHub] avro pull request #142: AVRO-1936: C++: adds new include guards

Posted by moriarty <gi...@git.apache.org>.
Github user moriarty closed the pull request at:

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


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