Issue 2513 - include/ac/localize.h breaks back-perl
Summary: include/ac/localize.h breaks back-perl
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-14 16:40 UTC by Hallvard Furuseth
Modified: 2014-08-01 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 Hallvard Furuseth 2003-05-14 16:40:20 UTC
Full_Name: Hallvard B. Furuseth
Version: HEAD
OS: Solaris
URL: 
Submission from: (NULL) (129.240.186.42)


include/ac/localize.h breaks back-perl:

- The definition
    #	define setlocale(c,l)		/* empty */
  breaks the declaration of setlocale() in <locale.h>.

  Fix: To conditionally define setlocale, #define something
  like ldap_pvt_setlocale() instead, and call that instead
  of setlocale in clients/tools/common.c.

- ac/localize.h #defines the macro `_', which Perl uses for
  prototypes.

  The simplest fix is to move
    #include <ac/localize.h>
  out of portable.h and into the files that need it, and if
  it is later used in back-perl, to put it after the Perl
  #include files with `#undef _' in front of it.

  If that's unacceptable, another fix *at the moment* is to put
  `#undef _' after `#include "portable.h"' in back-perl/*.c.  I
  expect that's insufficient in the long run since back-perl
  then can't be localized properly.

  One fix which apparently would not work is to move
    #include "asperl_undefs.h"
    #include <EXTERN.h>
    #include <perl.h>
  in front of the other #include files, followed by `#undef _'.
  The problem with this is that asperl_undefs.h does an #ifdef on
  HAVE_WIN32_ASPERL, which it claims is #defined in portable.h.
  However, I can't find it in portable.h or any other file.  Are
  this symbol and asperl_undefs.h obsolete, or has the support
  for them been lost and should be reinstated?

Comment 1 Howard Chu 2003-05-14 17:20:38 UTC
> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of
h.b.furuseth@usit.uio.no

>   One fix which apparently would not work is to move
>     #include "asperl_undefs.h"
>     #include <EXTERN.h>
>     #include <perl.h>
>   in front of the other #include files, followed by `#undef _'.
>   The problem with this is that asperl_undefs.h does an #ifdef on
>   HAVE_WIN32_ASPERL, which it claims is #defined in portable.h.
>   However, I can't find it in portable.h or any other file.  Are
>   this symbol and asperl_undefs.h obsolete, or has the support
>   for them been lost and should be reinstated?

The HAVE_WIN32_ASPERL macro is obsolete. I suppose that means the
asperl_undefs.h file is also obsolete, but I haven't built perl on Windows in
a long time.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

Comment 2 Kurt Zeilenga 2003-05-15 12:30:21 UTC
moved from Incoming to Development
Comment 3 Hallvard Furuseth 2003-06-03 15:14:20 UTC
Howard Chu writes:
>h.b.furuseth@usit.uio.no
>> 
>>   One fix which apparently would not work is to move
>>     #include "asperl_undefs.h"
>>     #include <EXTERN.h>
>>     #include <perl.h>
>>   in front of the other #include files, followed by `#undef _'.
>>   The problem with this is that asperl_undefs.h does an #ifdef on
>>   HAVE_WIN32_ASPERL, which it claims is #defined in portable.h.
>>   However, I can't find it in portable.h or any other file.  Are
>>   this symbol and asperl_undefs.h obsolete, or has the support
>>   for them been lost and should be reinstated?
> 
> The HAVE_WIN32_ASPERL macro is obsolete. I suppose that means the
> asperl_undefs.h file is also obsolete, but I haven't built perl on
> Windows in a long time.

I'll rename
   setlocale, textdomain, and bindtextdomain
in include/ac/localize.h to
   ldap_pvt_<function name>
so the definitions cannot break headers in /usr/include/, and move
   #include <EXTERN.h>
   #include <perl.h>
   #undef _ /* #defined used by both Perl and ac/localize.h */
   #include "asperl_undefs.h"
to the top of the back-perl files.

Someone who can test OpenLDAP on Windows can remove asperl_undefs.h
later if that file turns out to be obsolete.  If not, the fix may
have to be bigger, since asperl_undefs.h may depend on a new macro
from portable.h which will now be included _after_ asperl_undefs.h.

-- 
Hallvard

Comment 4 Hallvard Furuseth 2003-06-05 02:53:03 UTC
changed notes
Comment 5 Kurt Zeilenga 2003-06-16 18:46:13 UTC
changed notes
changed state Open to Test
Comment 6 Kurt Zeilenga 2003-06-22 04:34:24 UTC
changed notes
changed state Test to Closed
Comment 7 Howard Chu 2009-02-17 06:52:54 UTC
moved from Development to Archive.Development
Comment 8 OpenLDAP project 2014-08-01 21:05:18 UTC
Fixed in HEAD, except back-perl on Windows needs testing.
assumed okay