5

I need to use sys/ioctl.ph and it's not included in the perl version (5.12.3) shipped with my slackware distribution.

I did the following:

cd /usr/include
h2ph sys/ioctl.ph
cd /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi/
mkdir sys
mv ioctl.ph sys

Now the perl interpreter doesn't complain about the sys/ioctl.ph, but this is the error I get:

Illegal declaration of subroutine Functions::ServerSocket::__INT16_C at /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi/_h2ph_pre.ph line 164.

This is what there's in the file that causes the error at line 164:

unless (defined &__INT16_C(c)) { sub __INT16_C(c)() { &c } }

I don't know where to start. Functions::ServerSocket is one of my module, but I don't have any function like that in my file.

Zagorax
  • 11,440
  • 8
  • 44
  • 56

1 Answers1

0

The __INT16_C macro on your platform is probably simple, e.g.,

#define __INT16_C(c) c

Replace the code on line 164 with

eval 'sub __INT16_C {
    my($c) = @_;
    eval q($c);
}' unless defined (&__INT16_C);

which is what other versions of h2ph generate.

Greg Bacon
  • 134,834
  • 32
  • 188
  • 245