This "fixes" issue #6 by documenting the current state.
The bug requests a way to call define_macro with two arguments, but
David pointed out that define_macro("NAME=VALUE") already works.
Tom
From 4977934000d92c107d8d779476a2bfa2d84f9977 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tromey(a)redhat.com>
Date: Tue, 24 Jan 2012 13:29:16 -0700
Subject: [PATCH 1/2] Fix issue #6 by documenting that define_macro accepts a
definition as well.
---
docs/preprocessor.rst | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/docs/preprocessor.rst b/docs/preprocessor.rst
index 7e37f03..e4110f3 100644
--- a/docs/preprocessor.rst
+++ b/docs/preprocessor.rst
@@ -7,10 +7,17 @@ For languages that support a preprocessor, it's possible to inject
new
The motivation for this is to better support the creation of custom
attributes, by creating preprocessor names that can be tested against.
-.. py:function:: gcc.define_macro(name)
+.. py:function:: gcc.define_macro(argument)
- Defines a preprocessor macro with the given name, which may be of use
- for code that needs to test for the presence of your script.
+ Defines a preprocessor macro with the given argument, which may be
+ of use for code that needs to test for the presence of your script.
+ The argument can either be a simple name, or a name with a
+ definition:
+
+ .. code-block:: python
+
+ gcc.define_macro("SOMETHING") # define as the empty string
+ gcc.define_macro("SOMETHING=72")
This function can only be called from within specific event callbacks,
since it manipulates the state of the preprocessor for a given source
--
1.7.6.5