null+****@clear*****
null+****@clear*****
2012年 1月 29日 (日) 17:22:56 JST
Kouhei Sutou 2012-01-29 17:22:56 +0900 (Sun, 29 Jan 2012) New Revision: bf5a19949112ca3b324be683598e3060f88c5ca1 Log: [index] don't build offline index build code on Windows. Modified files: lib/db.c lib/ii.c Modified: lib/db.c (+4 -1) =================================================================== --- lib/db.c 2012-01-29 17:19:49 +0900 (f0a6ef9) +++ lib/db.c 2012-01-29 17:22:56 +0900 (52d21c3) @@ -5724,11 +5724,14 @@ build_index(grn_ctx *ctx, grn_obj *obj) if ((src = grn_ctx_at(ctx, *s))) { if ((target = GRN_OBJ_TABLEP(src) ? src : grn_ctx_at(ctx, src->header.domain))) { int i, ncol = DB_OBJ(obj)->source_size / sizeof(grn_id); +#ifndef WIN32 if (ncol == 1 && !GRN_OBJ_TABLEP(src) && getenv("USE_OFFLINE_INDEXER") && (!strcmp(getenv("USE_OFFLINE_INDEXER"), "yes"))) { grn_ii_build(ctx, (grn_ii *)obj); - } else { + } else +#endif /* WIN32 */ + { if ((col = GRN_MALLOC(ncol * sizeof(grn_obj *)))) { for (cp = col, i = ncol; i; s++, cp++, i--) { if (!(*cp = grn_ctx_at(ctx, *s))) { Modified: lib/ii.c (+2 -0) =================================================================== --- lib/ii.c 2012-01-29 17:19:49 +0900 (93a0293) +++ lib/ii.c 2012-01-29 17:22:56 +0900 (17961b2) @@ -6335,6 +6335,7 @@ grn_ii_inspect_elements(grn_ctx *ctx, grn_ii *ii, grn_obj *buf) GRN_TEXT_PUTS(ctx, buf, "]"); } +#ifndef WIN32 /********************** offline index builder ***********************/ const grn_id BUILD_RID_FLAG = 0x80000000; @@ -6853,3 +6854,4 @@ grn_ii_build(grn_ctx *ctx, grn_ii *ii) exit : return rc; } +#endif /* WIN32 */