Skip to content

Commit

Permalink
[index] don't build offline index build code on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 29, 2012
1 parent 8ca57b2 commit bf5a199
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/db.c
Expand Up @@ -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))) {
Expand Down
2 changes: 2 additions & 0 deletions lib/ii.c
Expand Up @@ -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;
Expand Down Expand Up @@ -6853,3 +6854,4 @@ grn_ii_build(grn_ctx *ctx, grn_ii *ii)
exit :
return rc;
}
#endif /* WIN32 */

0 comments on commit bf5a199

Please sign in to comment.