[cig-commits] commit:
Mercurial
hg at geodynamics.org
Mon Nov 24 11:58:31 PST 2008
changeset: 46:8b6e2cd06c72
user: LukeHodkinson
date: Wed Mar 05 01:15:22 2008 +0000
files: StgSCons meta-template.c
description:
Removing the need for a separate meta-template.c
file.
diff -r f9be03fd8b96 -r 8b6e2cd06c72 StgSCons
--- a/StgSCons Tue Mar 04 02:51:14 2008 +0000
+++ b/StgSCons Wed Mar 05 01:15:22 2008 +0000
@@ -255,8 +255,32 @@ def create_meta(target, source, env):
output_file.write(l[start+19:end])
output_file.write("\n")
break
- template_file=file("meta-template.c")
- output_file.write(template_file.read())
+ output_file.write('''
+#define Stg_Component_Stringify( str ) #str
+
+/* Note: Two macros are used to resolve the the extra macro level */
+#define Stg_Component_Metadata_Create( name ) Stg_Component_Metadata_Create_Macro( name )
+#define Stg_Component_Metadata_Create_Macro( name ) \
+ const char* name ##_Meta = XML_METADATA; \
+ const char* name ##_Name = #name; \
+ const char* name ##_Version = VERSION; \
+ const char* name ##_Type_GetMetadata() { /* hack...won't be needed when hierarchy rollout is done */\
+ return name ##_Meta; \
+ } \
+ const char* name ##_GetMetadata() { \
+ return name ##_Meta; \
+ } \
+ const char* name ##_GetName() { \
+ return name ##_Name; \
+ } \
+ const char* name ##_GetVersion() { \
+ return name ##_Version; \
+ }
+
+#if defined(COMPONENT_NAME) && defined(VERSION) && defined(XML_METADATA)
+ Stg_Component_Metadata_Create( COMPONENT_NAME )
+#endif
+''')
def gen_meta_suffix(env, sources):
return "-meta.c"
diff -r f9be03fd8b96 -r 8b6e2cd06c72 meta-template.c
--- a/meta-template.c Tue Mar 04 02:51:14 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-** Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-** Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-** Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-** Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-** Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-** Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-/* !!! This is an automatically generated file
- * !!! Do not make modifications here or they will be overwritten
- */
-#define Stg_Component_Stringify( str ) #str
-
-/* Note: Two macros are used to resolve the the extra macro level */
-#define Stg_Component_Metadata_Create( name ) Stg_Component_Metadata_Create_Macro( name )
-#define Stg_Component_Metadata_Create_Macro( name ) \
- const char* name ##_Meta = XML_METADATA; \
- const char* name ##_Name = #name; \
- const char* name ##_Version = VERSION; \
- const char* name ##_Type_GetMetadata() { /* hack...won't be needed when hierarchy rollout is done */\
- return name ##_Meta; \
- } \
- const char* name ##_GetMetadata() { \
- return name ##_Meta; \
- } \
- const char* name ##_GetName() { \
- return name ##_Name; \
- } \
- const char* name ##_GetVersion() { \
- return name ##_Version; \
- }
-
-
-#if defined(COMPONENT_NAME) && defined(VERSION) && defined(XML_METADATA)
-
- Stg_Component_Metadata_Create( COMPONENT_NAME )
-
-#endif
-
More information about the CIG-COMMITS
mailing list