Issue 7854 - minor patches to allow compile with VS2012
Summary: minor patches to allow compile with VS2012
Status: VERIFIED WONTFIX
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: build (show other issues)
Version: 2.4.39
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-14 08:16 UTC by louis@steelbytes.com
Modified: 2020-03-22 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description louis@steelbytes.com 2014-05-14 08:16:28 UTC
Full_Name: Louis Solomon
Version: 2.4.39
OS: Win32 & Win64
URL: 
Submission from: (NULL) (59.167.196.195)


1)
in libraries/libldap/ldif.c move int ldif_debug = 0; to after _all_ the
includes. Why? because the linker gets confused with it being declared as
declspec(dllexport). Order matters.

2)
in include/ac/socket.h EWOULDBLOCK, EINPROGRESS, ETIMEDOUT (lines 101-103)
conflict with the windows header files.  simply wrap with any rational choice of
ifdef/ifndef

3)
in include/ldap_utf8.h wrap prototypes for ldap_x_utf8_to_wc (line 61) through
to ldap_x_mbs_utf8s (line 99) with #if SIZEOF_WCHAR>=4 to match the ifdef at the
top of utf-8-conv.c.  Why?  because the linker tries to export them as they are
defined in the header with declspec(dllexport) but are not in any .o/.obj

4)
in include/ldap_cdefs.h the usage of __declspec(dllexport/dllimport) is not
quite right ... should be like

#if defined(_WIN32) 
	...
#	define LDAP_F(type)		__declspec(dllimport) type
#	define LDAP_V(type)		extern __declspec(dllimport) type
#else
#	define LDAP_F(type)		__declspec(dllexport) type
#	define LDAP_V(type)		extern __declspec(dllexport) type
#endif

and of course the same for each of the other sets (LBER, LDAP, LDAP_AVL,
LDAP_LDIF, etc)


With the above patches and making the appropriate .h files from .hin files
manually and then creating VS2012 project files, I was successfully able to
create and use liblber, libldap, libldap_r as .dlls
Comment 1 Quanah Gibson-Mount 2020-03-22 21:05:33 UTC
visual studio is not a supported nor desired build toolchain