require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_PTRACE_H_)) {
    eval 'sub _SYS_PTRACE_H_ () {1;}' unless defined(&_SYS_PTRACE_H_);
    eval 'sub PT_TRACE_ME () {0;}' unless defined(&PT_TRACE_ME);
    eval 'sub PT_READ_I () {1;}' unless defined(&PT_READ_I);
    eval 'sub PT_READ_D () {2;}' unless defined(&PT_READ_D);
    eval 'sub PT_WRITE_I () {4;}' unless defined(&PT_WRITE_I);
    eval 'sub PT_WRITE_D () {5;}' unless defined(&PT_WRITE_D);
    eval 'sub PT_CONTINUE () {7;}' unless defined(&PT_CONTINUE);
    eval 'sub PT_KILL () {8;}' unless defined(&PT_KILL);
    eval 'sub PT_ATTACH () {9;}' unless defined(&PT_ATTACH);
    eval 'sub PT_DETACH () {10;}' unless defined(&PT_DETACH);
    eval 'sub PT_IO () {11;}' unless defined(&PT_IO);
    eval 'sub PIOD_READ_D () {1;}' unless defined(&PIOD_READ_D);
    eval 'sub PIOD_WRITE_D () {2;}' unless defined(&PIOD_WRITE_D);
    eval 'sub PIOD_READ_I () {3;}' unless defined(&PIOD_READ_I);
    eval 'sub PIOD_WRITE_I () {4;}' unless defined(&PIOD_WRITE_I);
    eval 'sub PT_SET_EVENT_MASK () {12;}' unless defined(&PT_SET_EVENT_MASK);
    eval 'sub PT_GET_EVENT_MASK () {13;}' unless defined(&PT_GET_EVENT_MASK);
    eval 'sub PTRACE_FORK () {0x2;}' unless defined(&PTRACE_FORK);
    eval 'sub PT_GET_PROCESS_STATE () {14;}' unless defined(&PT_GET_PROCESS_STATE);
    eval 'sub PT_FIRSTMACH () {32;}' unless defined(&PT_FIRSTMACH);
    require 'machine/ptrace.ph';
    if(defined(&_KERNEL)) {
	if(!defined( &PT_GETREGS) || !defined( &PT_SETREGS)) {
	    die("Machine\ dependent\ ptrace\ not\ complete\.");
	}
	if(defined( &PT_GETFPREGS) || defined( &PT_SETFPREGS)) {
	}
	if(defined(&PT_GETFPREGS)) {
	}
	if(defined(&PT_SETFPREGS)) {
	}
	unless(defined(&FIX_SSTEP)) {
	    eval 'sub FIX_SSTEP {
	        my($p) = @_;
    		eval q();
	    }' unless defined(&FIX_SSTEP);
	}
    } else {
	require 'sys/cdefs.ph';
    }
}
1;
