Page MenuHomeFreeBSD

Remove a sunos4 silly #define that conflicts with c++
ClosedPublic

Authored by mat on Oct 14 2014, 10:59 AM.
Tags
None
Referenced Files
F103121739: D945.id1983.diff
Thu, Nov 21, 7:19 AM
Unknown Object (File)
Wed, Nov 20, 5:33 AM
Unknown Object (File)
Mon, Nov 18, 8:15 PM
Unknown Object (File)
Fri, Nov 15, 7:21 AM
Unknown Object (File)
Fri, Nov 8, 7:46 PM
Unknown Object (File)
Fri, Nov 8, 7:46 PM
Unknown Object (File)
Thu, Nov 7, 12:36 PM
Unknown Object (File)
Thu, Nov 7, 3:09 AM
Subscribers
None

Details

Reviewers
ohauer
mat
Summary

On 10.0, when apache modules are using c++, they fail building with errors like:

    libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I/usr/local/include/apache22 -I/usr/local/include/apr-1 -I/usr/local/include -L/usr/local/lib -I/usr/local/include -I/usr/local/include -Wall -O2 -pipe -I/usr/local/include -I/usr/include/openssl -fno-strict-aliasing -MT moid_ut
    ils.lo -MD -MP -MF .deps/moid_utils.Tpo -c moid_utils.cpp  -fPIC -DPIC -o .libs/moid_utils.o
    c++: warning: argument unused during compilation: '-L/usr/local/lib'
    c++: warning: argument unused during compilation: '-L/usr/local/lib'
    c++c++: : warning: argument unused during compilation: '-L/usr/local/lib'warning:
    argument unused during compilation: '-L/usr/local/lib'
    In file included from In file included from In file included from In file included from MoidConsumer.cppmod_auth_openid.cpp:In file included from :28http_helpers.cpp:
    :In file included from 2828./mod_auth_openid.h:
    :
    :In file included from In file included from ./mod_auth_openid.hmoid_utils.cppSessionManager.cpp:53./mod_auth_openid.h53::2828::
    53:
    :
    In file included from /usr/include/c++/v1/cstdlib./mod_auth_openid.hIn file included from :
    :
    :/usr/include/c++/v1/cstdlib::11653/usr/include/c++/v1/cstdlib116:
    ::9/usr/include/c++/v1/cstdlib./mod_auth_openid.h:: ::11653116error: :
    no member named 'strtoul_is_not_a_portable_function_use_strtol_instead' in the global namespace:
    9/usr/include/c++/v1/cstdlib9:::  using ::strtoul;error: error:
    no member named 'strtoul_is_not_a_portable_function_use_strtol_instead' in the global namespace116no member named 'strtoul_is_not_a_portable_function_use_strtol_instead' in the global namespace:      ~~^

    9
    /usr/local/include/apache22/httpd.h::1912 using ::strtoul;using ::strtoul;:
    17::
	   ~~^      ~~^error:

    /usr/local/include/apache22/httpd.h/usr/local/include/apache22/httpd.hnote: :expanded from macro 'strtoul':
    19121912:no member named 'strtoul_is_not_a_portable_function_use_strtol_instead' in the global namespace
    9:17#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead17::
    using ::strtoul;:                ^  note: note: expanded from macro 'strtoul'expanded from macro 'strtoul'



	  ~~^
    error: no member named 'strtoul_is_not_a_portable_function_use_strtol_instead' in the global namespace
    /usr/local/include/apache22/httpd.h:1912:17: note: expanded from macro 'strtoul'
    #define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
    using ::strtoul;                ^#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead

    #define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
	  ~~^                ^


		    ^

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

mat retitled this revision from to Remove a sunos4 silly #define that conflicts with c++.
mat updated this object.
mat edited the test plan for this revision. (Show Details)

In apache 2.4, they already removed this old thing.

Hi Mat,

is this only an issue for 10+ or also 8.4 and 9,3?
If the issue is only for 10+, then we should include this as EXTRA_PATCH.

I don't have a system with svn handy at the moment so what do you think about this self documented patch?

  • include/httpd.h.orig 2014-10-14 11:34:31 UTC

+++ include/httpd.h
@@ -1906,10 +1906,13 @@

const char * const *argv);

/ strtoul does not exist on sunos4. */
+/
https://reviews.freebsd.org/D945 */
+#ifdef SUNOS4
#ifdef strtoul
#undef strtoul
#endif
#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
+#endif /* D945 */

/* The C library has functions that allow const to be silently dropped ...
   these macros detect the drop in maintainer mode, but use the native
In D945#5, @ohauer wrote:

Hi Mat,

is this only an issue for 10+ or also 8.4 and 9,3?
If the issue is only for 10+, then we should include this as EXTRA_PATCH.

It affects when building with clang, it could happen on 8 or 9.

I don't have a system with svn handy at the moment so what do you think about this self documented patch?

It seems overly complicated, there is absolutely no reason to do that, just remove it, this was only a safeguard to prevent people developing apache itself, not modules, to use strtoul because it doesn't exist on sunos4, so that it would fail early while building whatever the current OS was.

In D945#6, @mat wrote:
In D945#5, @ohauer wrote:

Hi Mat,

is this only an issue for 10+ or also 8.4 and 9,3?
If the issue is only for 10+, then we should include this as EXTRA_PATCH.

It affects when building with clang, it could happen on 8 or 9.

I don't have a system with svn handy at the moment so what do you think about this self documented patch?

It seems overly complicated, there is absolutely no reason to do that, just remove it, this was only a safeguard to prevent people developing apache itself, not modules, to use strtoul because it doesn't exist on sunos4, so that it would fail early while building whatever the current OS was.

Hi Mat,

OK, then go on and commit your patch.

// olli

mat added a reviewer: mat.
This revision is now accepted and ready to land.Oct 14 2014, 1:56 PM