Merge lp:~hjd/widelands/freebsd-unlink into lp:widelands

Proposed by Hans Joachim Desserud
Status: Merged
Merged at revision: 7111
Proposed branch: lp:~hjd/widelands/freebsd-unlink
Merge into: lp:widelands
Diff against target: 11 lines (+1/-0)
1 file modified
src/io/filesystem/disk_filesystem.cc (+1/-0)
To merge this branch: bzr merge lp:~hjd/widelands/freebsd-unlink
Reviewer Review Type Date Requested Status
SirVer Approve
Hans Joachim Desserud Needs Resubmitting
Review via email: mp+226905@code.launchpad.net

Description of the change

Hello again :)

So after a bit back and forth, my freebsd-branch was merged and everything was working. Well, except that latest trunk failed to build on FreeBSD. Specifically src/io/filesystem/disk_filesystem.cc failed to find unlink().

I'm not quite sure how this broke it, but I noticed that the most recent change in this directory was removing the usage of boost/noncopyable [1]. After re-adding this include, it built fine again. Of course this wasn't going to be a permanent solution, so I looked around a bit and found unistd.h which contains unlink(). After including this, it now builds again.

I wonder whether the include should be moved down among the "only-include-when-not-on-Windows" includes though.

[1] http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/revision/7088#src/io/filesystem/filesystem.h

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

unistd.h is a unix only header. So you have to wrap it in a #ifdef.

Revision history for this message
Hans Joachim Desserud (hjd) :
review: Needs Resubmitting
Revision history for this message
SirVer (sirver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/io/filesystem/disk_filesystem.cc'
2--- src/io/filesystem/disk_filesystem.cc 2014-07-14 10:45:44 +0000
3+++ src/io/filesystem/disk_filesystem.cc 2014-07-15 19:44:37 +0000
4@@ -38,6 +38,7 @@
5 #include <sys/mman.h>
6 #include <sys/statvfs.h>
7 #include <sys/types.h>
8+#include <unistd.h>
9 #endif
10
11 #include "base/log.h"

Subscribers

People subscribed via source and target branches

to status/vote changes: