https://bugs.openldap.org/show_bug.cgi?id=9925
Issue ID: 9925 Summary: Fix some compilation issues around usage of #if and #ifdef Product: OpenLDAP Version: unspecified Hardware: x86_64 OS: Linux Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: connor.smith@hitachivantara.com Target Milestone: ---
Created attachment 918 --> https://bugs.openldap.org/attachment.cgi?id=918&action=edit git format-patch
I noticed a few issues while working with OpenLDAP that would lead to compiler warnings and the like in our particular build environment. They're quite minor, but it would still be good to have them patched upstream.
In include/ac/socket.h:
Use #elif defined(...) for HAVE_WINSOCK and MACOS. All other instances of these macros use #ifdef or similar. A compiler may warn about them not being defined.
In libraries/liblber/sockbuf.c, (DOS && PCNFS) and (DOS && NCSA) were replaced with HAVE_PCNFS and HAVE_NCSA, respectively. It seems logical to do the same at the only remaining occurrence of DOS, PCNFS, and NCSA.
For context on the latter: the actual warning was about #elif DOS, similar to #elif HAVE_WINSOCK and #elif MACOS, but looking into it it seemed to make sense to bring socket.h in line with sockbuf.c.
In libraries/liblunicode/ucdata/ucgendat.c:
Use #if HARDCODE_DATA consistently, replacing two instances of #ifdef. HARDCODE_DATA is always defined, and this way you can set HARDCODE_DATA to 0 and have it work, rather than it going down the wrong branch and failing in these two cases.
An IPR notice, with this work having been done as part of my employment:
The attached file is derived from OpenLDAP Software. All of the modifications to OpenLDAP Software represented in the following patch were developed by Hitachi Vantara. Hitachi Vantara has not assigned rights and/or interest in this work to any party. I, Connor Smith, am authorized by Hitachi Vantara, my employer, to release this work under the following terms.
Hitachi Vantara hereby place the following modifications to OpenLDAP Software (and only these modifications) into the public domain. Hence, these modifications may be freely used and/or redistributed for any purpose with or without attribution and/or other notice.
Please let me know if there are any issues with the attached patch, or if there's anything else I need to do. Thanks.