Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d94f707

Browse files
committed
Use the configure support to determine which ndbm.h header to include.
1 parent 641fbe6 commit d94f707

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Modules/dbmmodule.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
#include <sys/types.h>
88
#include <sys/stat.h>
99
#include <fcntl.h>
10+
11+
/* Some Linux systems install gdbm/ndbm.h, but not ndbm.h. This supports
12+
* whichever configure was able to locate.
13+
*/
14+
#if defined(HAVE_NDBM_H)
1015
#include <ndbm.h>
16+
#elif defined(HAVE_GDBM_NDBM_H)
17+
#include <gdbm/ndbm.h>
18+
#else
19+
#error "No ndbm.h available!"
20+
#endif
1121

1222
typedef struct {
1323
PyObject_HEAD

0 commit comments

Comments
 (0)