Skip to content

Commit

Permalink
Issue #2399 - Fix LDAP on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Andrews committed Dec 2, 2023
1 parent 041e7e7 commit c84c618
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
25 changes: 13 additions & 12 deletions ldap/c-sdk/include/lber.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,23 @@
#ifndef _LBER_H
#define _LBER_H

#include <stdlib.h> /* to pick up size_t typedef */

#ifndef macintosh
#if defined( _WINDOWS ) || defined( _WIN32) || defined( _CONSOLE )
#include <winsock.h> /* for SOCKET */
typedef SOCKET LBER_SOCKET;
#else
typedef long LBER_SOCKET;
#endif /* _WINDOWS */
#else /* macintosh */
typedef void *LBER_SOCKET;
#endif /* macintosh */

#ifdef __cplusplus
extern "C" {
#endif

#include <stdlib.h> /* to pick up size_t typedef */

/*
* Note that LBER_ERROR and LBER_DEFAULT are values that can never appear
* as valid BER tags, and so it is safe to use them to report errors. In
Expand Down Expand Up @@ -130,16 +141,6 @@ typedef struct berelement BerElement;
typedef struct sockbuf Sockbuf;
typedef int (*BERTranslateProc)( char **bufp, ber_uint_t *buflenp,
int free_input );
#ifndef macintosh
#if defined( _WINDOWS ) || defined( _WIN32) || defined( _CONSOLE )
#include <winsock.h> /* for SOCKET */
typedef SOCKET LBER_SOCKET;
#else
typedef long LBER_SOCKET;
#endif /* _WINDOWS */
#else /* macintosh */
typedef void *LBER_SOCKET;
#endif /* macintosh */

/* calling conventions used by library */
#ifndef LDAP_CALL
Expand Down
8 changes: 4 additions & 4 deletions ldap/c-sdk/include/ldap-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
#ifndef _LDAP_PLATFORM_H
#define _LDAP_PLATFORM_H

#ifdef __cplusplus
extern "C" {
#endif

#if defined (WIN32) || defined (_WIN32) || defined( _CONSOLE )
#include <windows.h>
# if defined( _WINDOWS )
Expand Down Expand Up @@ -74,6 +70,10 @@ extern "C" {
#include <sys/select.h>
#endif /* XP_OS2 */

#ifdef __cplusplus
extern "C" {
#endif

/*
* LDAP_API macro definition:
*/
Expand Down
8 changes: 4 additions & 4 deletions ldap/c-sdk/include/ldap-standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
#ifndef _LDAP_STANDARD_H
#define _LDAP_STANDARD_H

#ifdef __cplusplus
extern "C" {
#endif

#include "ldap-platform.h"

#include "lber.h"

#ifdef __cplusplus
extern "C" {
#endif

#define LDAP_PORT 389
#define LDAPS_PORT 636
#define LDAP_VERSION2 2
Expand Down
3 changes: 2 additions & 1 deletion ldap/c-sdk/include/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@
* 13 August 1993 Mark C Smith
*/

#include "ldap.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "ldap.h"

#if !defined( NEEDPROTOS ) && defined( __STDC__ )
#define NEEDPROTOS
Expand Down
8 changes: 4 additions & 4 deletions ldap/c-sdk/liblber/lber-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
#ifndef _LBERINT_H
#define _LBERINT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
Expand Down Expand Up @@ -115,6 +111,10 @@ extern "C" {

#include "lber.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifdef macintosh
#define NSLDAPI_LBER_SOCKET_IS_PTR
#endif
Expand Down

0 comments on commit c84c618

Please sign in to comment.