Page MenuHomeFreeBSD

Define ipfilter's SOLARIS macro in a more portable way
ClosedPublic

Authored by dim on Aug 27 2016, 10:17 PM.
Tags
None
Referenced Files
F103343065: D7671.diff
Sat, Nov 23, 7:50 PM
F103306747: D7671.diff
Sat, Nov 23, 8:32 AM
Unknown Object (File)
Thu, Nov 7, 9:00 AM
Unknown Object (File)
Tue, Nov 5, 9:04 AM
Unknown Object (File)
Sun, Nov 3, 9:07 PM
Unknown Object (File)
Sun, Nov 3, 9:07 PM
Unknown Object (File)
Sun, Nov 3, 8:32 PM
Unknown Object (File)
Sat, Nov 2, 8:11 PM
Subscribers

Details

Summary

From clang 3.9.0 I'm getting this warning about ipfilter's SOLARIS
macro:

In file included from ioctl.c:82:
/usr/obj/usr/src/tmp/usr/include/netinet/ip_fil.h:1080:6: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
# if    SOLARIS
        ^
/usr/obj/usr/src/tmp/usr/include/netinet/ip_compat.h:35:18: note: expanded from macro 'SOLARIS'
#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
                 ^

This can easily be done in a defined and portable way.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim retitled this revision from to Define ipfilter's SOLARIS macro in a more portable way.
dim updated this object.
dim edited the test plan for this revision. (Show Details)
dim added reviewers: cy, glebius.
dim added a subscriber: emaste.
cy edited edge metadata.

Looks good.

Ultimately as I go through the code, all non-FreeBSD code will be removed. This works for now. Thanks.

This revision is now accepted and ready to land.Aug 27 2016, 11:57 PM
This revision was automatically updated to reflect the committed changes.