Take the 2-minute tour ×

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer


