develooper Front page | perl.perl5.porters | Postings from March 2001

Hiding global macros (embed.h)

Thread Next
From:
Dana Prescott Kennedy Powers
Date:
March 15, 2001 00:40
Subject:
Hiding global macros (embed.h)
Message ID:
3AB0800C.8C6F8BCC@slothlovechunk.org
Ive been working on embedding perl w/ multiplicity, but Ive come upon
the following problem that I cant seem to figure out:
I have a function named 'lex_start' in my code, but embed.h insists on
redefining it to the perl_lex_start macro. I cant seem to figure out
what i need to -D or #define in order to hide the global symbols and to
get the following to compile ( w / 5.6.0 ):

#include <EXTERN.h>
#include <perl.h>
#define SAY_HELLO "-e", "print qq(Hi, I'm $^X\n)"
int main(int argc, char **argv, char **env)
{
  PerlInterpreter
    *one_perl = perl_alloc(),
    *two_perl = perl_alloc();
  char *one_args[] = { "one_perl", SAY_HELLO };
  char *two_args[] = { "two_perl", SAY_HELLO };
  perl_construct(one_perl);
  perl_construct(two_perl);
  perl_parse(one_perl, NULL, 3, one_args, (char **)NULL);
  perl_parse(two_perl, NULL, 3, two_args, (char **)NULL);
  perl_run(one_perl);
  perl_run(two_perl);
  perl_destruct(one_perl);
  perl_destruct(two_perl);
  perl_free(one_perl);
  perl_free(two_perl);
}

void lex_start( void )
{
  printf("Well then\n");
}


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About