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
Unknown Object (File)
Wed, Jun 18, 3:11 PM
Unknown Object (File)
Tue, Jun 17, 4:33 AM
Unknown Object (File)
Sun, Jun 15, 12:22 PM
Unknown Object (File)
Jun 3 2025, 10:49 AM
Unknown Object (File)
Jun 3 2025, 9:10 AM
Unknown Object (File)
Apr 28 2025, 7:03 AM
Unknown Object (File)
Mar 29 2025, 9:25 PM
Unknown Object (File)
Mar 25 2025, 6:33 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
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 4956
Build 5021: arc lint + arc unit

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.