Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Centralize P5/Parrot header cruft in one file

  • Loading branch information...
commit 9e586b09bca2434bc0344f71a61f1a655f407420 1 parent 4c0982a
@sorear sorear authored
View
17 src/pmc/bkmarshal.c
@@ -12,26 +12,15 @@ src/pmc/p5marshal.c - wrap P5 and Parrot calling conventions
*/
-/* Various Perl 5 headers that we need. */
-#undef _
-#define PERL_NO_GET_CONTEXT
-#include <EXTERN.h>
-#include <perl.h>
-#include <XSUB.h>
-
-
-/* Plus need to know about the interpreter and scalar wrapper. */
+/* Need to know about the interpreter and scalar wrapper. */
#define PARROT_IN_EXTENSION
#define CONST_STRING(i, s) Parrot_str_new_constant((i), s)
#define CONST_STRING_GEN(i, s) Parrot_str_new_constant((i), s)
#include "parrot/parrot.h"
#include "parrot/extend.h"
#include "parrot/dynext.h"
-#include "pmc_p5interpreter.h"
-#include "pmc_p5scalar.h"
-#include "pmc_p5namespace.h"
-#include "bkmarshal.h"
-#include "parrot/oplib/ops.h"
+
+#include "blizkost.h"
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
View
7 src/pmc/bkmarshal.h
@@ -4,7 +4,7 @@ Copyright (C) 2009-2010, Jonathan Worthington and friends
=head1 NAME
-src/pmc/p5marshal.c - wrap P5 and Parrot calling conventions
+src/pmc/bkmarshal.h - wrap P5 and Parrot calling conventions
=head1 DESCRIPTION
@@ -15,11 +15,6 @@ src/pmc/p5marshal.c - wrap P5 and Parrot calling conventions
#ifndef BLIZKOST_MARSHAL_H_GUARD
#define BLIZKOST_MARSHAL_H_GUARD
-/* Various Perl 5 headers that we need. */
-#undef _
-#include <EXTERN.h>
-#include <perl.h>
-
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
SV *blizkost_marshal_arg(PARROT_INTERP, PMC *p5i, PMC *arg);
View
39 src/pmc/blizkost.h
@@ -0,0 +1,39 @@
+/*
+Copyright (C) 2009-2010, Jonathan Worthington and friends
+$Id$
+
+=head1 NAME
+
+src/pmc/blizkost.h - centralize P5+Parrot header cruft
+
+=head1 DESCRIPTION
+
+Perl5 and Parrot headers like to trample on each other. This module
+does the necessary cruft to import both in the same file.
+
+=cut
+
+*/
+
+#ifndef BLIZKOST_H_GUARD
+#define BLIZKOST_H_GUARD
+
+#define PARROT_IN_EXTENSION
+#include "parrot/parrot.h"
+#include "parrot/extend.h"
+#include "parrot/dynext.h"
+
+#define PERL_NO_GET_CONTEXT
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+
+#include "pmc_p5interpreter.h"
+#include "pmc_p5invocation.h"
+#include "pmc_p5namespace.h"
+#include "pmc_p5sv.h"
+#include "pmc_p5scalar.h"
+
+#include "bkmarshal.h"
+
+#endif
View
18 src/pmc/p5interpreter.pmc
@@ -13,26 +13,10 @@ These are the vtable functions for the P5Interpreter class.
*/
-/* Various Perl 5 headers plus XS initialization. */
-#undef __attribute__
-#undef __attribute__noreturn__
-#undef __attribute__deprecated__
+#include "blizkost.h"
-#undef __attribute__pure__
-#undef __attribute__format__
-#undef __attribute__nonnull__
-#undef __attribute__warn_unused_result__
-#undef __attribute__unused__
-
-
-#define __attribute__(x) /* */
#include "init_with_xs.h"
-/* Need to know a bit about other PMCs. */
-#include "pmc_p5scalar.h"
-#include "pmc_p5namespace.h"
-#include "bkmarshal.h"
-
/* Tracking of whether we've initialized or not. */
static int inited = 0;
View
21 src/pmc/p5invocation.pmc
@@ -15,26 +15,7 @@ invocation model and calling conventions.
*/
-/* Various Perl 5 headers that we need. */
-#undef __attribute__
-#undef __attribute__noreturn__
-#undef __attribute__deprecated__
-#undef __attribute__pure__
-#undef __attribute__format__
-#undef __attribute__nonnull__
-#undef __attribute__warn_unused_result__
-#undef __attribute__unused__
-#define __attribute__(x) /* */
-#include <EXTERN.h>
-#include <perl.h>
-
-/* Plus need to know about the interpreter and scalar wrapper. */
-#include "pmc_p5interpreter.h"
-#include "pmc_p5scalar.h"
-#include "pmc_p5namespace.h"
-#include "parrot/oplib/ops.h"
-
-#include "bkmarshal.h"
+#include "blizkost.h"
pmclass P5Invocation group blizkost_group dynpmc {
ATTR PMC *p5i;
View
18 src/pmc/p5namespace.pmc
@@ -14,23 +14,7 @@ These are the vtable functions for the P5Namespace class.
*/
-/* Various Perl 5 headers that we need. */
-#undef __attribute__
-#undef __attribute__noreturn__
-#undef __attribute__deprecated__
-#undef __attribute__pure__
-#undef __attribute__format__
-#undef __attribute__nonnull__
-#undef __attribute__warn_unused_result__
-#undef __attribute__unused__
-#define __attribute__(x) /* */
-#include <EXTERN.h>
-#include <perl.h>
-
-/* Plus need to know about some other PMCs. */
-#include "pmc_p5interpreter.h"
-#include "pmc_p5invocation.h"
-#include "pmc_p5scalar.h"
+#include "blizkost.h"
pmclass P5Namespace group blizkost_group dynpmc {
ATTR PMC *p5i;
View
18 src/pmc/p5scalar.pmc
@@ -14,23 +14,7 @@ These are the vtable functions for the P5Scalar class.
*/
-/* Various Perl 5 headers that we need. */
-#undef __attribute__
-#undef __attribute__noreturn__
-#undef __attribute__deprecated__
-#undef __attribute__pure__
-#undef __attribute__format__
-#undef __attribute__nonnull__
-#undef __attribute__warn_unused_result__
-#undef __attribute__unused__
-#define __attribute__(x) /* */
-#include <EXTERN.h>
-#include <perl.h>
-
-/* Plus need to know about the interpreter and invocation PMCs. */
-#include "pmc_p5interpreter.h"
-#include "pmc_p5invocation.h"
-#include "pmc_p5sv.h"
+#include "blizkost.h"
pmclass P5Scalar extends P5SV group blizkost_group dynpmc {
View
16 src/pmc/p5sv.pmc
@@ -14,21 +14,7 @@ These are the vtable functions for the P5SV class.
*/
-/* Various Perl 5 headers that we need. */
-#undef __attribute__
-#undef __attribute__noreturn__
-#undef __attribute__deprecated__
-#undef __attribute__pure__
-#undef __attribute__format__
-#undef __attribute__nonnull__
-#undef __attribute__warn_unused_result__
-#undef __attribute__unused__
-#define __attribute__(x) /* */
-#include <EXTERN.h>
-#include <perl.h>
-
-/* Plus need to know about the interpreter PMC. */
-#include "pmc_p5interpreter.h"
+#include "blizkost.h"
pmclass P5SV group blizkost_group dynpmc {
ATTR PMC *p5i;
Please sign in to comment.
Something went wrong with that request. Please try again.