require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_LDAP_CDEFS_H)) {
    eval 'sub _LDAP_CDEFS_H () {1;}' unless defined(&_LDAP_CDEFS_H);
    if(defined(&__cplusplus) || defined(&c_plusplus)) {
	eval 'sub LDAP_BEGIN_DECL () { &extern "C" {;}' unless defined(&LDAP_BEGIN_DECL);
	eval 'sub LDAP_END_DECL () {};}' unless defined(&LDAP_END_DECL);
    } else {
	eval 'sub LDAP_BEGIN_DECL () {1;}' unless defined(&LDAP_BEGIN_DECL);
	eval 'sub LDAP_END_DECL () {1;}' unless defined(&LDAP_END_DECL);
    }
    if(!defined(&LDAP_NO_PROTOTYPES)  && ( defined(&LDAP_NEEDS_PROTOTYPES) || defined(&__STDC__) || defined(&__cplusplus) || defined(&c_plusplus) )) {
	eval 'sub LDAP_P {
	    my($protos) = @_;
    	    eval q($protos);
	}' unless defined(&LDAP_P);
	eval 'sub LDAP_CONCAT1 {
	    my($x,$y) = @_;
    	    eval q($x  $y);
	}' unless defined(&LDAP_CONCAT1);
	eval 'sub LDAP_CONCAT {
	    my($x,$y) = @_;
    	    eval q( &LDAP_CONCAT1($x,$y));
	}' unless defined(&LDAP_CONCAT);
	eval 'sub LDAP_STRING {
	    my($x) = @_;
    	    eval q($x);
	}' unless defined(&LDAP_STRING);
	eval 'sub LDAP_XSTRING {
	    my($x) = @_;
    	    eval q( &LDAP_STRING($x));
	}' unless defined(&LDAP_XSTRING);
	unless(defined(&LDAP_CONST)) {
	    eval 'sub LDAP_CONST () { &const;}' unless defined(&LDAP_CONST);
	}
    } else {
	eval 'sub LDAP_P {
	    my($protos) = @_;
    	    eval q(());
	}' unless defined(&LDAP_P);
	eval 'sub LDAP_CONCAT {
	    my($x,$y) = @_;
    	    eval q($x $y);
	}' unless defined(&LDAP_CONCAT);
	eval 'sub LDAP_STRING {
	    my($x) = @_;
    	    eval q(\\"x\\");
	}' unless defined(&LDAP_STRING);
	unless(defined(&LDAP_CONST)) {
	    eval 'sub LDAP_CONST () {1;}' unless defined(&LDAP_CONST);
	}
    }
    if(((defined(&__GNUC__) ? &__GNUC__ : undef)) * 1000+ ((defined(&__GNUC_MINOR__) ? &__GNUC_MINOR__ : undef)) >= 2006) {
	eval 'sub LDAP_GCCATTR {
	    my($attrs) = @_;
    	    eval q( &__attribute__($attrs));
	}' unless defined(&LDAP_GCCATTR);
    } else {
	eval 'sub LDAP_GCCATTR {
	    my($attrs) = @_;
    	    eval q();
	}' unless defined(&LDAP_GCCATTR);
    }
    if(defined(&_WIN32)  && ((defined(&LDAP_LIBS_DYNAMIC)  && !defined(&LBER_LIBRARY)) || (!defined(&LDAP_LIBS_DYNAMIC)  && defined(&SLAPD_IMPORT)))) {
	eval 'sub LBER_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LBER_F);
	eval 'sub LBER_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LBER_V);
    } else {
	eval 'sub LBER_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LBER_F);
	eval 'sub LBER_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LBER_V);
    }
    if(defined(&_WIN32)  && ((defined(&LDAP_LIBS_DYNAMIC)  && !defined(&LDAP_LIBRARY)) || (!defined(&LDAP_LIBS_DYNAMIC)  && defined(&SLAPD_IMPORT)))) {
	eval 'sub LDAP_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_F);
	eval 'sub LDAP_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_V);
    } else {
	eval 'sub LDAP_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_F);
	eval 'sub LDAP_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_AVL_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_AVL_F);
	eval 'sub LDAP_AVL_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_AVL_V);
    } else {
	eval 'sub LDAP_AVL_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_AVL_F);
	eval 'sub LDAP_AVL_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_AVL_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_LDIF_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LDIF_F);
	eval 'sub LDAP_LDIF_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LDIF_V);
    } else {
	eval 'sub LDAP_LDIF_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LDIF_F);
	eval 'sub LDAP_LDIF_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LDIF_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_LUNICODE_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LUNICODE_F);
	eval 'sub LDAP_LUNICODE_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LUNICODE_V);
    } else {
	eval 'sub LDAP_LUNICODE_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LUNICODE_F);
	eval 'sub LDAP_LUNICODE_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LUNICODE_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_LUTIL_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LUTIL_F);
	eval 'sub LDAP_LUTIL_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LUTIL_V);
    } else {
	eval 'sub LDAP_LUTIL_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LUTIL_F);
	eval 'sub LDAP_LUTIL_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LUTIL_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_REWRITE_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_REWRITE_F);
	eval 'sub LDAP_REWRITE_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_REWRITE_V);
    } else {
	eval 'sub LDAP_REWRITE_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_REWRITE_F);
	eval 'sub LDAP_REWRITE_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_REWRITE_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_SLAPD_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_SLAPD_F);
	eval 'sub LDAP_SLAPD_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_SLAPD_V);
    } else {
	eval 'sub LDAP_SLAPD_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_SLAPD_F);
	eval 'sub LDAP_SLAPD_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_SLAPD_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub LDAP_SLAPI_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_SLAPI_F);
	eval 'sub LDAP_SLAPI_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_SLAPI_V);
    } else {
	eval 'sub LDAP_SLAPI_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_SLAPI_F);
	eval 'sub LDAP_SLAPI_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_SLAPI_V);
    }
    if(defined(&_WIN32)  && defined(&SLAPD_IMPORT)) {
	eval 'sub SLAPI_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&SLAPI_F);
	eval 'sub SLAPI_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&SLAPI_V);
    } else {
	eval 'sub SLAPI_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&SLAPI_F);
	eval 'sub SLAPI_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&SLAPI_V);
    }
    if((defined(&__MINGW32__)  && !defined(&CSTATIC)) || (defined(&_MSC_VER)  && defined(&_DLL))) {
	eval 'sub LDAP_LIBC_F {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LIBC_F);
	eval 'sub LDAP_LIBC_V {
	    my($type) = @_;
    	    eval q( &extern  &__declspec( &dllimport) $type);
	}' unless defined(&LDAP_LIBC_V);
    } else {
	eval 'sub LDAP_LIBC_F {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LIBC_F);
	eval 'sub LDAP_LIBC_V {
	    my($type) = @_;
    	    eval q( &extern $type);
	}' unless defined(&LDAP_LIBC_V);
    }
}
1;
