Merge branch 'redesign' of github.com:kthakore/SDL_perl into redesign
[sdlgit/SDL_perl.git] / src / defines.h
CommitLineData
bfd90409 1//
2// defines.h
3//
4// Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
5//
6// ------------------------------------------------------------------------------
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Lesser General Public
10// License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Lesser General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// ------------------------------------------------------------------------------
23//
24// Please feel free to send questions, suggestions or improvements to:
25//
26// David J. Goehrig
27// dgoehrig@cpan.org
28//
29
30#ifndef SDL_PERL_DEFINES_H
31#define SDL_PERL_DEFINES_H
32
33#ifdef HAVE_TLS_CONTEXT
34PerlInterpreter *parent_perl = NULL;
35extern PerlInterpreter *parent_perl;
36#define GET_TLS_CONTEXT parent_perl = PERL_GET_CONTEXT;
37#define ENTER_TLS_CONTEXT \
38 PerlInterpreter *current_perl = PERL_GET_CONTEXT; \
39 PERL_SET_CONTEXT(parent_perl); { \
40 PerlInterpreter *my_perl = parent_perl;
41#define LEAVE_TLS_CONTEXT \
42 } PERL_SET_CONTEXT(current_perl);
43#else
44#define GET_TLS_CONTEXT /* TLS context not enabled */
45#define ENTER_TLS_CONTEXT /* TLS context not enabled */
46#define LEAVE_TLS_CONTEXT /* TLS context not enabled */
47#endif
48
49#endif