Preserve compatibility with the currently packaged OpenLDAP libraries.

--- python-ldap-2.2.0~/Modules/errors.c
+++ python-ldap-2.2.0/Modules/errors.c
@@ -17,9 +17,16 @@
 
 /* list of error objects */
 
+#if LDAP_VENDOR_VERSION>=20200
+/* OpenLDAP 2.2+ defines negative error constants */
 #define LDAP_ERROR_MIN          LDAP_REFERRAL_LIMIT_EXCEEDED
 #define LDAP_ERROR_MAX          LDAP_OTHER
 #define LDAP_ERROR_OFFSET       -LDAP_ERROR_MIN
+#else
+#define LDAP_ERROR_MIN          0
+#define LDAP_ERROR_MAX          LDAP_REFERRAL_LIMIT_EXCEEDED
+#define LDAP_ERROR_OFFSET       0
+#endif
 
 static PyObject* errobjects[ LDAP_ERROR_MAX-LDAP_ERROR_MIN+1 ];
 
