Commit 299ce6f9 authored by Alexandre Julliard's avatar Alexandre Julliard

makedep: Add a helper function to check if a string exists in an array.

parent f9ddafa8
......@@ -343,14 +343,23 @@ static void strarray_addall( struct strarray *array, struct strarray added )
/*******************************************************************
* strarray_add_uniq
* strarray_exists
*/
static void strarray_add_uniq( struct strarray *array, const char *str )
static int strarray_exists( struct strarray *array, const char *str )
{
unsigned int i;
for (i = 0; i < array->count; i++) if (!strcmp( array->str[i], str )) return;
strarray_add( array, str );
for (i = 0; i < array->count; i++) if (!strcmp( array->str[i], str )) return 1;
return 0;
}
/*******************************************************************
* strarray_add_uniq
*/
static void strarray_add_uniq( struct strarray *array, const char *str )
{
if (!strarray_exists( array, str )) strarray_add( array, str );
}
......@@ -2417,16 +2426,12 @@ static void update_makefile( const char *path )
if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module;
make->use_msvcrt = 0;
for (i = 0; i < make->appmode.count && !make->use_msvcrt; i++)
make->use_msvcrt = !strcmp( make->appmode.str[i], "-mno-cygwin" );
make->is_win16 = strarray_exists( &make->extradllflags, "-m16" );
make->use_msvcrt = strarray_exists( &make->appmode, "-mno-cygwin" );
for (i = 0; i < make->imports.count && !make->use_msvcrt; i++)
make->use_msvcrt = !strncmp( make->imports.str[i], "msvcr", 5 );
make->is_win16 = 0;
for (i = 0; i < make->extradllflags.count && !make->is_win16; i++)
if (!strcmp( make->extradllflags.str[i], "-m16" )) make->is_win16 = 1;
make->include_args = empty_strarray;
make->define_args = empty_strarray;
strarray_add( &make->define_args, "-D__WINESRC__" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment