Skip to content

Commit

Permalink
added standard style conditional compilation guards for unistd.h (ifn…
Browse files Browse the repository at this point in the history
…def OS_WIN) (issue #7)
  • Loading branch information
Dmitry Savintsev committed Feb 15, 2013
1 parent 8e2cf41 commit 3abacc5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions ipc/chromium/src/base/file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

#if defined(OS_WIN)
#include <io.h>
// commented out #if defined(ANDROID) to prevent the compile error
// due to undefine ftrunctate on Linux
#else
#include <unistd.h>
#endif
#include <stdio.h>
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif

#include <fstream>

Expand Down
3 changes: 1 addition & 2 deletions ipc/chromium/src/base/file_util_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include "base/file_util.h"

#include <fcntl.h>
#ifndef OS_WIN
// https://bugzilla.mozilla.org/show_bug.cgi?id=736765 - added unistd.h to avoid compile error (DS)
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif

Expand Down
4 changes: 1 addition & 3 deletions ipc/chromium/src/base/message_pump_libevent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

#include <errno.h>
#include <fcntl.h>
#ifndef OS_WIN
// https://bugzilla.mozilla.org/show_bug.cgi?id=746526 - added unistd.h
// to avoid compile error on Linux
#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif

Expand Down
7 changes: 4 additions & 3 deletions ipc/chromium/src/base/time_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// found in the LICENSE file.

#include "base/time.h"
#ifndef OS_WIN
#include <unistd.h>
#endif

#ifdef OS_MACOSX
#include <mach/mach_time.h>
Expand All @@ -17,6 +14,10 @@
#include <time.h>
#endif

#if defined(ANDROID) || defined(OS_POSIX)
#include <unistd.h>
#endif

#include <limits>

#include "base/basictypes.h"
Expand Down

0 comments on commit 3abacc5

Please sign in to comment.