[pypy-commit] pypy stmgc-c4: Port the trick from pypysig_getaddr_occurred() to the two other functions
arigo
noreply at buildbot.pypy.org
Thu Sep 26 11:17:42 CEST 2013
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c4
Changeset: r67108:d63ff723e98d
Date: 2013-09-26 09:06 +0200
http://bitbucket.org/pypy/pypy/changeset/d63ff723e98d/
Log: Port the trick from pypysig_getaddr_occurred() to the two other
functions (which were not used far).
diff --git a/rpython/translator/c/src/signals.c b/rpython/translator/c/src/signals.c
--- a/rpython/translator/c/src/signals.c
+++ b/rpython/translator/c/src/signals.c
@@ -43,6 +43,19 @@
return (void *)(&pypysig_counter);
}
+#undef pypysig_get_occurred
+long pypysig_get_occurred(void)
+{
+ return pypysig_counter.value;
+}
+
+#undef pypysig_set_occurred
+void pypysig_set_occurred(long nvalue)
+{
+ pypysig_counter.value = nvalue;
+}
+
+
void pypysig_ignore(int signum)
{
#ifdef SA_RESTART
diff --git a/rpython/translator/c/src/signals.h b/rpython/translator/c/src/signals.h
--- a/rpython/translator/c/src/signals.h
+++ b/rpython/translator/c/src/signals.h
@@ -24,9 +24,10 @@
use macros when compiling as a stand-alone program, but still
export a function with the correct name for testing */
void *pypysig_getaddr_occurred(void);
+long pypysig_get_occurred(void);
+void pypysig_set_occurred(long);
#define pypysig_getaddr_occurred() ((void *)(&pypysig_counter))
-
-static long pypysig_get_occurred(void) { return pypysig_counter.value; }
-static void pypysig_set_occurred(long value) { pypysig_counter.value = value; }
+#define pypysig_get_occurred() (pypysig_counter.value)
+#define pypysig_set_occurred(nv) (pypysig_counter.value = nv)
#endif
More information about the pypy-commit
mailing list