[glibmm] gmmproc: _CONFIGINCLUDE() + _IS_DEPRECATED = #include in .cc file



commit 1b5cab8581c9c412ea2cf3f5f7b5de0add9d870d
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sat Dec 5 11:49:41 2015 +0100

    gmmproc: _CONFIGINCLUDE() + _IS_DEPRECATED = #include in .cc file
    
    * tools/m4/base.m4: If both _CONFIGINCLUDE() and _IS_DEPRECATED are used
    in the .hg file, then #include <xxxconfig.h> is included before
    ifndef xxx_DISABLE_DEPRECATED in the generated .cc file. This is useful if
    the mm module is configured with --disable-deprecated-api, because
    xxx_DISABLE_DEPRECATED is defined in the config file. The .cc file can be
    compiled, but does not generate any executable code. No need to exclude it
    from the build by tampering with the filelist.am file.

 tools/m4/base.m4 |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/tools/m4/base.m4 b/tools/m4/base.m4
index 6734b2a..a577075 100644
--- a/tools/m4/base.m4
+++ b/tools/m4/base.m4
@@ -236,6 +236,10 @@ define(`_CONFIGINCLUDE',`dnl
 _PUSH(SECTION_HEADER_FIRST)
 #include <$1>
 _POP()
+_PUSH()
+dnl Define this macro to be tested for later.
+define(`__FILENAME_CONFIGINCLUDE__',`$1')
+_POP()
 ')
 
 dnl Start of processing
@@ -261,14 +265,26 @@ define(`_DEPRECATE_IFDEF_END',`dnl
 #endif // __DEPRECATION_GUARD__'
 )
 
-dnl begin optional deprecation of whole class
+dnl begin optional deprecation of whole file
 define(`_DEPRECATE_IFDEF_CLASS_START',`dnl
 ifdef(`__BOOL_DEPRECATED__',`dnl
 _DEPRECATE_IFDEF_START',`dnl
 ')
 ')
 
-dnl end optional deprecation of whole class
+dnl begin optional deprecation of whole file,
+dnl preceded by inclusion of config file
+dnl (the config file may define the __DEPRECATION_GUARD__)
+define(`_DEPRECATE_IFDEF_CLASS_CONFIG_START',`dnl
+ifdef(`__BOOL_DEPRECATED__',`dnl
+ifdef(`__FILENAME_CONFIGINCLUDE__',`dnl
+#include <__FILENAME_CONFIGINCLUDE__>',`dnl
+')
+_DEPRECATE_IFDEF_START',`dnl
+')
+')
+
+dnl end optional deprecation of whole file
 define(`_DEPRECATE_IFDEF_CLASS_END',`dnl
 ifdef(`__BOOL_DEPRECATED__',`dnl
 _DEPRECATE_IFDEF_END',`dnl
@@ -283,7 +299,6 @@ define(`_END',`dnl
 m4_divert(0)dnl
 #S 0 dnl Marks the beginning of the header file.
 
-// -*- c++ -*-
 // Generated by gmmproc __GLIBMM_VERSION__ -- DO NOT MODIFY!
 #ifndef __HEADER_GUARD__`'_H
 #define __HEADER_GUARD__`'_H
@@ -306,7 +321,6 @@ _DEPRECATE_IFDEF_CLASS_END
 
 #S 1 dnl Marks the beginning of the private header file.
 
-// -*- c++ -*-
 // Generated by gmmproc __GLIBMM_VERSION__ -- DO NOT MODIFY!
 #ifndef __HEADER_GUARD__`'_P_H
 #define __HEADER_GUARD__`'_P_H
@@ -321,7 +335,7 @@ _DEPRECATE_IFDEF_CLASS_END
 
 _IMPORT(SECTION_CC_PRE_INCLUDES)
 
-_DEPRECATE_IFDEF_CLASS_START
+_DEPRECATE_IFDEF_CLASS_CONFIG_START
 
 #include <glibmm.h>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]