-
Notifications
You must be signed in to change notification settings - Fork 136
Expand file tree
/
Copy pathcommon.h
More file actions
39 lines (28 loc) · 771 Bytes
/
common.h
File metadata and controls
39 lines (28 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* common utility macros
* See https://www.python-ldap.org/ for details. */
#ifndef __h_common
#define __h_common
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#if defined(MS_WINDOWS)
#include <winsock.h>
#else /* unix */
#include <netdb.h>
#include <sys/time.h>
#include <sys/types.h>
#endif
#include <string.h>
#define streq( a, b ) \
( (*(a)==*(b)) && 0==strcmp(a,b) )
extern PyObject *LDAPerror_TypeError(const char *, PyObject *);
void LDAPadd_methods(PyObject *d, PyMethodDef *methods);
#define PyNone_Check(o) ((o) == Py_None)
/* Py2/3 compatibility */
#if PY_VERSION_HEX >= 0x03000000
/* In Python 3, alias PyInt to PyLong */
#define PyInt_FromLong PyLong_FromLong
#endif
#endif /* __h_common_ */