Opened 5 years ago

Last modified 5 years ago

#3835 accepted enhancement

guard unistd.h by ifndef _WIN32

Reported by: fdupont Owned by: fdupont
Priority: low Milestone: Windows
Component: Unclassified Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


unistd.h is a Unix specific file so its include must be guarded as in:

#ifndef _WIN32
#include <unistd.h>


Change History (3)

comment:1 Changed 5 years ago by fdupont

  • Owner set to fdupont
  • Status changed from new to accepted

comment:2 Changed 5 years ago by fdupont

Note if we choose to use a fake unistd.h to avoid _WIN32 in master branch sources it should include getopt.h.
(PS: I checked on OS X, FreeBSD and Ubuntu Linux: getopt() is defined in unistd.h, in addition in the last one getopt.h defines the getopt_long extension. Note if we want to use this extension in Kea I have the portable code for it too).
Another consequence is getopt.h should be removed from src/lib/log/compiler/ which includes unistd.h too.

comment:3 Changed 5 years ago by hschempf

  • Milestone changed from Kea-proposed to Windows
Note: See TracTickets for help on using tickets.