Menu

#39 Include the/config.h in every header

1.0
accepted
None
2012-10-04
2012-09-07
Christoph
No

In order for the configuration to work correctly, the/config.h must be included in every header of thelib. I recommend adapting the style guide, too. Stuff should look like:

#ifndef THE_SYSTEM_SYSTEM_EXCEPTION_H_INCLUDED
#define THE_SYSTEM_SYSTEM_EXCEPTION_H_INCLUDED
#if (defined(_MSC_VER) && (_MSC_VER > 1000))
#pragma once
#endif /* (defined(_MSC_VER) && (_MSC_VER > 1000)) */
#if defined(_WIN32) && defined(_MANAGED)
#pragma managed(push, off)
#endif /* defined(_WIN32) && defined(_MANAGED) */

#include "the/config.h"

#include "the/system/system_message.h"
#include "the/exception.h"


namespace the {
namespace system {

Discussion

  • Christoph

    Christoph - 2012-09-07

    I don't know how I did this formatting...

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,5 +1,6 @@
     In order for the configuration to work correctly, the/config.h must be included in every header of thelib. I recommend adapting the style guide, too. Stuff should look like:
    
    +~~~~~
     #ifndef THE_SYSTEM_SYSTEM_EXCEPTION_H_INCLUDED
     #define THE_SYSTEM_SYSTEM_EXCEPTION_H_INCLUDED
     #if (defined(_MSC_VER) && (_MSC_VER > 1000))
    @@ -17,3 +18,4 @@
    
     namespace the {
     namespace system {
    +~~~~~
    
     
  • SGrottel

    SGrottel - 2012-09-07

    We (read: guido) should provide a perl script to test that each .h file in the thelib/include directory includes #include "the/config.h" before any other include statements. The script should print all file names which do not handle this correctly and could summarize the number of header files which do.

    I will (now) update the crowbar28 style guide to include this rule.

     
  • Guido Reina

    Guido Reina - 2012-10-04
    • status: open --> accepted

    • assigned_to: Guido Reina

     
  • Guido Reina

    Guido Reina - 2012-10-04

    I will see to that

     

Log in to post a comment.