Commit 9951f2f4 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

makedep: Do not forbid importing system headers in msvcrt modules.

The apparent intention of catching mistakes early is laudable. However, the number of exceptions both in the code and not in the code (in particular, valgrind.h) shows that this is clearly getting in the way more often than not. In practice an attempt to compile with a system API we don't support will be met with a clear error at link time, e.g.: /usr/bin/x86_64-w64-mingw32-ld: dlls/xmllite/reader.cross.o: in function `debugstr_nodetype': /home/whatsit/git/wine64/../wine/dlls/xmllite/reader.c:116: undefined reference to `pthread_once' And when there is no external function involved (as with stdarg.h, x86intrin.h, valgrind.h), there's no reason to prevent use of the headers. The motivation for this patch is the ability to import system vkd3d.h in e.g. d3d12 and dxgi, which do not link to libvkd3d directly (but rather indirectly through wined3d) and so do not fall under the has_external_import() exception. I could see no simple way to adapt has_external_import() to account for this case. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3f942a32
......@@ -1360,22 +1360,6 @@ static struct makefile *find_importlib_module( const char *name )
/*******************************************************************
* has_external_import
*/
static int has_external_import( const struct makefile *make )
{
unsigned int i;
for (i = 0; i < make->imports.count; i++)
{
if (!strncmp( make->imports.str[i], "-l", 2 ))
return 1;
}
return 0;
}
/*******************************************************************
* open_include_file
*/
static struct file *open_include_file( const struct makefile *make, struct incl_file *pFile )
......@@ -1452,17 +1436,6 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
return file;
}
if (pFile->type == INCL_SYSTEM && pFile->use_msvcrt &&
!make->extlib && !pFile->included_by->is_external)
{
if (!strcmp( pFile->name, "stdarg.h" )) return NULL;
if (!strcmp( pFile->name, "x86intrin.h" )) return NULL;
if (has_external_import( make )) return NULL;
fprintf( stderr, "%s:%d: error: system header %s cannot be used with msvcrt\n",
pFile->included_by->file->name, pFile->included_line, pFile->name );
exit(1);
}
if (pFile->type == INCL_SYSTEM) return NULL; /* ignore system files we cannot find */
/* try in src file directory */
......
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