Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: martine/ninja
base: cce1b98548
...
head fork: martine/ninja
compare: 0c64d16e89
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 07, 2012
@martine drop special case for msvc bucket count
Calling bucket_count() works locally with MSVC.  I wonder if some
other change in the code fixed this.
3133023
Alex Caudill add GetProcessorCount() implementation for Solaris 2c145bb
@martine disable a new warning that popped up on Windows
This pattern is safe as long as you're careful; we don't use it
very much.
c840cf6
Alex Caudill add solaris platform definitions 241b290
Alex Caudill include termios for solaris 0c64d16
Showing with 20 additions and 8 deletions.
  1. +6 −2 configure.py
  2. +4 −0 src/build.cc
  3. +1 −6 src/ninja.cc
  4. +9 −0 src/util.cc
View
8 configure.py
@@ -27,7 +27,7 @@
import ninja_syntax
parser = OptionParser()
-platforms = ['linux', 'freebsd', 'mingw', 'windows']
+platforms = ['linux', 'freebsd', 'solaris', 'mingw', 'windows']
profilers = ['gmon', 'pprof']
parser.add_option('--platform',
help='target platform (' + '/'.join(platforms) + ')',
@@ -59,6 +59,8 @@
platform = 'linux'
elif platform.startswith('freebsd'):
platform = 'freebsd'
+ elif platform.startswith('solaris'):
+ platform = 'solaris'
elif platform.startswith('mingw'):
platform = 'mingw'
elif platform.startswith('win'):
@@ -118,6 +120,8 @@ def binary(name):
'/WX', # Warnings as errors.
'/wd4530', '/wd4100', '/wd4706',
'/wd4512', '/wd4800', '/wd4702', '/wd4819',
+ # Disable warnings about passing "this" during initialization.
+ '/wd4355',
'/GR-', # Disable RTTI.
# Disable size_t -> int truncation warning.
# We never have strings or arrays larger than 2**31.
@@ -220,7 +224,7 @@ def shell_escape(str):
objs = []
-if platform not in ('mingw', 'windows'):
+if platform not in ('solaris', 'mingw', 'windows'):
n.comment('browse_py.h is used to inline browse.py.')
n.rule('inline',
command='src/inline.sh $varname < $in > $out',
View
4 src/build.cc
@@ -26,6 +26,10 @@
#include <sys/time.h>
#endif
+#if defined(__SVR4) && defined(__sun)
+#include <sys/termios.h>
+#endif
+
#include "build_log.h"
#include "disk_interface.h"
#include "graph.h"
View
7 src/ninja.cc
@@ -633,12 +633,7 @@ void DumpMetrics(Globals* globals) {
printf("\n");
int count = (int)globals->state->paths_.size();
- int buckets =
-#ifdef _MSC_VER
- (int)globals->state->paths_.comp.bucket_size;
-#else
- (int)globals->state->paths_.bucket_count();
-#endif
+ int buckets = (int)globals->state->paths_.bucket_count();
printf("path->node hash load %.2f (%d entries / %d buckets)\n",
count / (double) buckets, count, buckets);
}
View
9 src/util.cc
@@ -36,6 +36,9 @@
#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sysctl.h>
+#elif defined(__SVR4) && defined(__sun)
+#include <unistd.h>
+#include <sys/loadavg.h>
#elif defined(linux)
#include <sys/sysinfo.h>
#endif
@@ -314,6 +317,12 @@ int GetProcessorCount() {
GetSystemInfo(&info);
return info.dwNumberOfProcessors;
}
+#else
+// This is what get_nprocs() should be doing in the Linux implementation
+// above, but in a more standard way.
+int GetProcessorCount() {
+ return sysconf(_SC_NPROCESSORS_ONLN);
+}
#endif
#ifdef _WIN32

No commit comments for this range

Something went wrong with that request. Please try again.