From 46059cc63259f7a3d408fc1e52e8da9d37dc49ff Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 15 Nov 2008 04:08:14 -0800 Subject: Makefile: introduce NO_PTHREADS This introduces make variable NO_PTHREADS for platforms that lack the support for pthreads library or people who do not want to use it for whatever reason. When defined, it makes the multi-threaded index preloading into a no-op, and also disables threaded delta searching by pack-objects. Signed-off-by: Junio C Hamano Signed-off-by: Mike Ralphson Tested-by: Johannes Sixt (AIX 4.3.x) Signed-off-by: Junio C Hamano --- preload-index.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'preload-index.c') diff --git a/preload-index.c b/preload-index.c index a6855837a4..88edc5f8a9 100644 --- a/preload-index.c +++ b/preload-index.c @@ -2,6 +2,14 @@ * Copyright (C) 2008 Linus Torvalds */ #include "cache.h" + +#ifdef NO_PTHREADS +static void preload_index(struct index_state *index, const char **pathspec) +{ + ; /* nothing */ +} +#else + #include /* @@ -81,6 +89,7 @@ static void preload_index(struct index_state *index, const char **pathspec) die("unable to join threaded lstat"); } } +#endif int read_index_preload(struct index_state *index, const char **pathspec) { -- cgit v1.2.3