SF.net SVN: geany: [1917] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Sep 28 11:48:55 UTC 2007


Revision: 1917
          http://geany.svn.sourceforge.net/geany/?rev=1917&view=rev
Author:   ntrel
Date:     2007-09-28 04:48:55 -0700 (Fri, 28 Sep 2007)

Log Message:
-----------
Add --no-preprocessing, -P option when generating tags files to
disable preprocessing of C/C++ source files.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/main.c
    trunk/src/symbols.c
    trunk/src/symbols.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-09-28 10:54:56 UTC (rev 1916)
+++ trunk/ChangeLog	2007-09-28 11:48:55 UTC (rev 1917)
@@ -4,6 +4,9 @@
    Also ignore Ctrl-L for VTE bash command.
    Allow 'Switch to editor' command to override any bash commands.
    Also disable the popup menu to avoid VTE bash conflicts.
+ * src/main.c, src/symbols.c, src/symbols.h:
+   Add --no-preprocessing, -P option when generating tags files to
+   disable preprocessing of C/C++ source files.
 
 
 2007-09-27  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2007-09-28 10:54:56 UTC (rev 1916)
+++ trunk/src/main.c	2007-09-28 11:48:55 UTC (rev 1917)
@@ -104,6 +104,7 @@
 #endif
 static gboolean generate_datafiles = FALSE;
 static gboolean generate_tags = FALSE;
+static gboolean no_preprocessing = FALSE;
 static gboolean ft_names = FALSE;
 static gboolean no_plugins = FALSE;
 
@@ -115,7 +116,8 @@
 	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &debug_mode, N_("Runs in debug mode (means being verbose)"), NULL },
 	{ "ft-names", 0, 0, G_OPTION_ARG_NONE, &ft_names, N_("Print internal filetype names"), NULL },
 	{ "generate-tags", 'g', 0, G_OPTION_ARG_NONE, &generate_tags, N_("Generate global tags file (see documentation)"), NULL },
-	{ "generate-data-files", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &generate_datafiles, "", NULL },
+	{ "no-preprocessing", 'P', 0, G_OPTION_ARG_NONE, &no_preprocessing, NULL, NULL },
+	{ "generate-data-files", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &generate_datafiles, NULL, NULL },
 #ifdef HAVE_SOCKET
 	{ "new-instance", 'i', 0, G_OPTION_ARG_NONE, &ignore_socket, N_("Don't open files in a running instance, force opening a new instance"), NULL },
 #endif
@@ -458,7 +460,7 @@
 
 		filetypes_init_types();
 		configuration_read_filetype_extensions();	// needed for *.lang.tags filetype matching
-		ret = symbols_generate_global_tags(*argc, *argv);
+		ret = symbols_generate_global_tags(*argc, *argv, ! no_preprocessing);
 		exit(ret);
 	}
 

Modified: trunk/src/symbols.c
===================================================================
--- trunk/src/symbols.c	2007-09-28 10:54:56 UTC (rev 1916)
+++ trunk/src/symbols.c	2007-09-28 11:48:55 UTC (rev 1917)
@@ -857,7 +857,7 @@
  * the relevant path.
  * Example:
  * CFLAGS=-I/home/user/libname-1.x geany -g libname.d.tags libname.h */
-int symbols_generate_global_tags(int argc, char **argv)
+int symbols_generate_global_tags(int argc, char **argv, gboolean want_preprocess)
 {
 	/* -E pre-process, -dD output user macros, -p prof info (?),
 	 * -undef remove builtin macros (seems to be needed with FC5 gcc 4.1.1 */
@@ -881,7 +881,7 @@
 			g_printerr(_("Unknown filetype extension for \"%s\".\n"), tags_file);
 			return 1;
 		}
-		if (ft->lang == 0 || ft->lang == 1)	/* C/C++ */
+		if (want_preprocess && (ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP))
 			command = g_strdup_printf("%s %s", pre_process, NVL(getenv("CFLAGS"), ""));
 		else
 			command = NULL;	// don't preprocess

Modified: trunk/src/symbols.h
===================================================================
--- trunk/src/symbols.h	2007-09-28 10:54:56 UTC (rev 1916)
+++ trunk/src/symbols.h	2007-09-28 11:48:55 UTC (rev 1917)
@@ -44,7 +44,7 @@
 
 gboolean symbols_recreate_tag_list(gint idx, gboolean sort_by_name);
 
-gint symbols_generate_global_tags(gint argc, gchar **argv);
+gint symbols_generate_global_tags(gint argc, gchar **argv, gboolean want_preprocess);
 
 void symbols_show_load_tags_dialog();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list