Howdy, I recently tried compiling Wine with tcc, which found a few bugs. I've filed some on Savannah (and have before as well), but that didn't garner much attention, so I'm writing here as well. If that's unwelcome, please let me know and I'll refrain :).
Now then, I used wine-1.5.12 (recent development snapshot), and tinycc from git (commit 56e23984b9cd3b58e1766748524e63f8301ccd68). Compared to 0.9.25, it gets much further, a couple of my bugs were fixed already: https://savannah.nongnu.org/bugs/?33010 - configure misses most dependencies https://savannah.nongnu.org/bugs/?33713 - tinycc doesn't support u_int64_t the new bugs: https://savannah.nongnu.org/bugs/?37240 - tinycc: unknown opcode 'movq' https://savannah.nongnu.org/bugs/?37241 - tinycc: 'error: bad expression syntax [.]' on some wine files https://savannah.nongnu.org/bugs/?37242 - tinycc: tmarshal.h:761: error: identifier expected (wine) https://savannah.nongnu.org/bugs/?37243 - tinycc: fails to compile wine's dlls/d3d8/tests/stateblock.c file https://savannah.nongnu.org/bugs/?37244 - tinycc: lacks -nostartfiles -nodefaultlibs support, needed by Wine there are a couple other issues, that I haven't filed bugs for: A) running ./configure fails to detect libhal and opengl. This can be worked around by doing: CC="tcc -L/usr/lib" ./configure B) TinyCC doesn't seem to support DECLSPEC_HIDDEN / DECLSPEC_HOTPATCH. C) There are some other areas that fail to compile, though those appear to be Wine bugs. I've attached a (very hacky) patch that (mostly) allows wine to compile. For the files mentioned above that don't compile, make CC=gcc was used to work around it. After that, wine segfaults on launch, so there's obviously more work to be done, but these issues make narrowing down that problem harder. I'd be happy to test any tcc patches, if needed. I've attached testcases for some of the bugs, when possible. I attempted to use delta (http://delta.tigris.org/) to narrow down the problems more, but it seems tinycc doesn't support dumping the preprocessed code? -- -Austin
commit 9a9171901c3145df95e421eeab55c7ab005d0661 Author: Austin English <austin@debian> Date: Fri Aug 31 15:04:58 2012 -0700 asdf diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c index 385ace4..d0ad0e7 100644 --- a/dlls/advapi32/lsa.c +++ b/dlls/advapi32/lsa.c @@ -627,7 +627,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy( */ PPOLICY_PRIMARY_DOMAIN_INFO pinfo; - pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name)); + //pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name)); TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer)); @@ -677,7 +677,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy( */ PPOLICY_DNS_DOMAIN_INFO pinfo; - pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name)); + //pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name)); TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer)); diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index ea85cbc..950fe4b 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -149,7 +149,7 @@ BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, */ HCRYPTPROV CRYPT_GetDefaultProvider(void) DECLSPEC_HIDDEN; -HINSTANCE hInstance DECLSPEC_HIDDEN; +extern HINSTANCE hInstance DECLSPEC_HIDDEN; void crypt_oid_init(void) DECLSPEC_HIDDEN; void crypt_oid_free(void) DECLSPEC_HIDDEN; diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c index 3405447..84d1469 100644 --- a/dlls/d3d8/d3d8_main.c +++ b/dlls/d3d8/d3d8_main.c @@ -35,7 +35,7 @@ void WINAPI DebugSetMute(void) { /* nothing to do */ } -IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version) +extern IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version) { struct d3d8 *object; diff --git a/dlls/d3d8/tests/Makefile.in b/dlls/d3d8/tests/Makefile.in index 14fa2fc..7df81bf 100644 --- a/dlls/d3d8/tests/Makefile.in +++ b/dlls/d3d8/tests/Makefile.in @@ -5,7 +5,6 @@ C_SRCS = \ buffer.c \ d3d8_main.c \ device.c \ - stateblock.c \ surface.c \ texture.c \ visual.c \ diff --git a/dlls/d3d9/tests/Makefile.in b/dlls/d3d9/tests/Makefile.in index 4c4ce0f..b3be706 100644 --- a/dlls/d3d9/tests/Makefile.in +++ b/dlls/d3d9/tests/Makefile.in @@ -7,7 +7,6 @@ C_SRCS = \ device.c \ query.c \ shader.c \ - stateblock.c \ surface.c \ texture.c \ vertexdeclaration.c \ diff --git a/dlls/d3dx9_36/tests/Makefile.in b/dlls/d3dx9_36/tests/Makefile.in index 5384705..01bc538 100644 --- a/dlls/d3dx9_36/tests/Makefile.in +++ b/dlls/d3dx9_36/tests/Makefile.in @@ -6,9 +6,6 @@ C_SRCS = \ core.c \ effect.c \ line.c \ - math.c \ - mesh.c \ - shader.c \ surface.c \ texture.c \ volume.c diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index eb582da..efd4827 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -203,9 +203,9 @@ HRESULT IDirectSoundBufferImpl_Duplicate( IDirectSoundBufferImpl **ppdsb, IDirectSoundBufferImpl *pdsb) DECLSPEC_HIDDEN; void secondarybuffer_destroy(IDirectSoundBufferImpl *This) DECLSPEC_HIDDEN; -const IDirectSound3DListenerVtbl ds3dlvt DECLSPEC_HIDDEN; -const IDirectSound3DBufferVtbl ds3dbvt DECLSPEC_HIDDEN; -const IKsPropertySetVtbl iksbvt DECLSPEC_HIDDEN; +extern const IDirectSound3DListenerVtbl ds3dlvt DECLSPEC_HIDDEN; +extern const IDirectSound3DBufferVtbl ds3dbvt DECLSPEC_HIDDEN; +extern const IKsPropertySetVtbl iksbvt DECLSPEC_HIDDEN; HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN; diff --git a/dlls/gphoto2.ds/gphoto2_i.h b/dlls/gphoto2.ds/gphoto2_i.h index edc4d91..eb0e50f 100644 --- a/dlls/gphoto2.ds/gphoto2_i.h +++ b/dlls/gphoto2.ds/gphoto2_i.h @@ -71,7 +71,7 @@ struct gphoto2_file { }; /* internal information about an active data source */ -struct tagActiveDS +extern struct tagActiveDS { TW_IDENTITY identity; /* identity */ TW_UINT16 currentState; /* current state */ diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 39b491e..6103b14 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -245,13 +245,13 @@ typedef struct { DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9); -nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*); -nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*); -void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt); -void (__cdecl *ccref_unmark_if_purple)(nsCycleCollectingAutoRefCnt*); -void (__cdecl *ccp_init)(nsXPCOMCycleCollectionParticipant*,const CCObjCallback*); -void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,size_t,const char*,nsCycleCollectionTraversalCallback*); -void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*); +extern nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*); +extern nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*); +extern void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt); +extern void (__cdecl *ccref_unmark_if_purple)(nsCycleCollectingAutoRefCnt*); +extern void (__cdecl *ccp_init)(nsXPCOMCycleCollectionParticipant*,const CCObjCallback*); +extern void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,size_t,const char*,nsCycleCollectionTraversalCallback*); +extern void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*); void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN; void release_dispex(DispatchEx*) DECLSPEC_HIDDEN; diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 43ac194..27aae48 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -39,7 +39,7 @@ #include "wine/debug.h" static const BOOL is_64bit = sizeof(void *) > sizeof(int); -BOOL is_wow64; +extern BOOL is_wow64; #define MSI_DATASIZEMASK 0x00ff #define MSITYPE_VALID 0x0100 diff --git a/dlls/msvcp100/exception.c b/dlls/msvcp100/exception.c index a81fb54..e13cf9c 100644 --- a/dlls/msvcp100/exception.c +++ b/dlls/msvcp100/exception.c @@ -667,7 +667,7 @@ static const cxx_exception_type failure_cxx_type = { &failure_cxx_type_table }; -#ifndef __GNUC__ +#ifdef _MSC_VER_ void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(type_info, @@ -696,7 +696,7 @@ void __asm_dummy_vtables(void) { __ASM_VTABLE(failure, VTABLE_ADD_FUNC(MSVCP_failure_vector_dtor) VTABLE_ADD_FUNC(MSVCP_failure_what)); -#ifndef __GNUC__ +#ifdef _MSC_VER_ } #endif diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c index 3e3bad8..985d675 100644 --- a/dlls/msvcp100/ios.c +++ b/dlls/msvcp100/ios.c @@ -611,7 +611,7 @@ DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar), DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf), &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@"); -#ifndef __GNUC__ +#ifdef _MSC_VER_ void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(iosb, @@ -838,7 +838,7 @@ void __asm_dummy_vtables(void) { VTABLE_ADD_FUNC(basic_streambuf_char_setbuf) VTABLE_ADD_FUNC(basic_streambuf_char_sync) VTABLE_ADD_FUNC(basic_streambuf_char_imbue)); -#ifndef __GNUC__ +#ifdef __MSC_VER__ } #endif diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c index b217232..397721e 100644 --- a/dlls/msvcp100/locale.c +++ b/dlls/msvcp100/locale.c @@ -8379,7 +8379,7 @@ DEFINE_RTTI_DATA1(num_put_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$nu DEFINE_RTTI_DATA1(num_put_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@"); DEFINE_RTTI_DATA1(num_put_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@"); -#ifndef __GNUC__ +#ifdef _MSC_VER_ void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(locale_facet, @@ -8561,7 +8561,7 @@ void __asm_dummy_vtables(void) { VTABLE_ADD_FUNC(num_put_short_do_put_ulong) VTABLE_ADD_FUNC(num_put_short_do_put_long) VTABLE_ADD_FUNC(num_put_short_do_put_bool)); -#ifndef __GNUC__ +#ifdef _MSC_VER_ } #endif diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 7da6cbe..1e5c976 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -667,7 +667,7 @@ static const cxx_exception_type failure_cxx_type = { &failure_cxx_type_table }; -#ifndef __GNUC__ +#ifdef _MSC_VER_ void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(type_info, @@ -696,7 +696,7 @@ void __asm_dummy_vtables(void) { __ASM_VTABLE(failure, VTABLE_ADD_FUNC(MSVCP_failure_vector_dtor) VTABLE_ADD_FUNC(MSVCP_failure_what)); -#ifndef __GNUC__ +#ifdef _MSC_VER_ } #endif diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 31b5b70..84c4a40 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -8530,7 +8530,7 @@ DEFINE_RTTI_DATA1(num_put_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$nu DEFINE_RTTI_DATA1(num_put_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@"); DEFINE_RTTI_DATA1(num_put_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@"); -#ifndef __GNUC__ +#ifdef _MSC_VER_ void __asm_dummy_vtables(void) { #endif __ASM_VTABLE(locale_facet, @@ -8718,7 +8718,7 @@ void __asm_dummy_vtables(void) { VTABLE_ADD_FUNC(num_put_short_do_put_ulong) VTABLE_ADD_FUNC(num_put_short_do_put_long) VTABLE_ADD_FUNC(num_put_short_do_put_bool)); -#ifndef __GNUC__ +#ifdef _MSC_VER_ } #endif diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 230d405..4738c17 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -477,7 +477,7 @@ double CDECL MSVCRT_tanh( double x ) } -#if defined(__GNUC__) && defined(__i386__) +#if (defined(__GNUC__) || defined(__TINYC__)) && defined(__i386__) #define FPU_DOUBLE(var) double var; \ __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : ) @@ -1952,9 +1952,13 @@ void _safe_fprem1(void) void __cdecl __libm_sse2_acos(void) { double d; +#ifndef __TINYC__ __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = acos( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -1962,10 +1966,14 @@ void __cdecl __libm_sse2_acos(void) */ void __cdecl __libm_sse2_acosf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = acosf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -1973,10 +1981,14 @@ void __cdecl __libm_sse2_acosf(void) */ void __cdecl __libm_sse2_asin(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = asin( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -1984,10 +1996,14 @@ void __cdecl __libm_sse2_asin(void) */ void __cdecl __libm_sse2_asinf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = asinf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -1995,10 +2011,14 @@ void __cdecl __libm_sse2_asinf(void) */ void __cdecl __libm_sse2_atan(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = atan( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2006,10 +2026,14 @@ void __cdecl __libm_sse2_atan(void) */ void __cdecl __libm_sse2_atan2(void) { +#ifndef __TINYC__ double d1, d2; __asm__ __volatile__( "movq %%xmm0,%0; movq %%xmm1,%1 " : "=m" (d1), "=m" (d2) ); d1 = atan2( d1, d2 ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d1) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2017,10 +2041,14 @@ void __cdecl __libm_sse2_atan2(void) */ void __cdecl __libm_sse2_atanf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = atanf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2028,10 +2056,14 @@ void __cdecl __libm_sse2_atanf(void) */ void __cdecl __libm_sse2_cos(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = cos( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2039,10 +2071,14 @@ void __cdecl __libm_sse2_cos(void) */ void __cdecl __libm_sse2_cosf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = cosf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2050,10 +2086,14 @@ void __cdecl __libm_sse2_cosf(void) */ void __cdecl __libm_sse2_exp(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = exp( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2061,10 +2101,14 @@ void __cdecl __libm_sse2_exp(void) */ void __cdecl __libm_sse2_expf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = expf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2072,10 +2116,14 @@ void __cdecl __libm_sse2_expf(void) */ void __cdecl __libm_sse2_log(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = log( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2083,10 +2131,14 @@ void __cdecl __libm_sse2_log(void) */ void __cdecl __libm_sse2_log10(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = log10( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2094,10 +2146,14 @@ void __cdecl __libm_sse2_log10(void) */ void __cdecl __libm_sse2_log10f(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = log10f( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2105,10 +2161,14 @@ void __cdecl __libm_sse2_log10f(void) */ void __cdecl __libm_sse2_logf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = logf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2116,10 +2176,14 @@ void __cdecl __libm_sse2_logf(void) */ void __cdecl __libm_sse2_pow(void) { +#ifndef __TINYC__ double d1, d2; __asm__ __volatile__( "movq %%xmm0,%0; movq %%xmm1,%1 " : "=m" (d1), "=m" (d2) ); d1 = pow( d1, d2 ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d1) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2127,10 +2191,14 @@ void __cdecl __libm_sse2_pow(void) */ void __cdecl __libm_sse2_powf(void) { +#ifndef __TINYC__ float f1, f2; __asm__ __volatile__( "movd %%xmm0,%0; movd %%xmm1,%1" : "=g" (f1), "=g" (f2) ); f1 = powf( f1, f2 ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f1) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2138,10 +2206,14 @@ void __cdecl __libm_sse2_powf(void) */ void __cdecl __libm_sse2_sin(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = sin( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2149,10 +2221,14 @@ void __cdecl __libm_sse2_sin(void) */ void __cdecl __libm_sse2_sinf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = sinf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2160,10 +2236,14 @@ void __cdecl __libm_sse2_sinf(void) */ void __cdecl __libm_sse2_tan(void) { +#ifndef __TINYC__ double d; __asm__ __volatile__( "movq %%xmm0,%0" : "=m" (d) ); d = tan( d ); __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } /*********************************************************************** @@ -2171,10 +2251,14 @@ void __cdecl __libm_sse2_tan(void) */ void __cdecl __libm_sse2_tanf(void) { +#ifndef __TINYC__ float f; __asm__ __volatile__( "movd %%xmm0,%0" : "=g" (f) ); f = tanf( f ); __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); +#else + FIXME("Doesn't work on tinycc\n"); +#endif } #endif /* __i386__ */ diff --git a/dlls/sane.ds/sane_i.h b/dlls/sane.ds/sane_i.h index ae58159..81f6c07 100644 --- a/dlls/sane.ds/sane_i.h +++ b/dlls/sane.ds/sane_i.h @@ -59,7 +59,7 @@ extern HINSTANCE SANE_instance DECLSPEC_HIDDEN; #define TWCC_CHECKSTATUS (TWCC_CUSTOMBASE + 1) /* internal information about an active data source */ -struct tagActiveDS +extern struct tagActiveDS { struct tagActiveDS *next; /* next active DS */ TW_IDENTITY identity; /* identity */ diff --git a/dlls/secur32/secur32_priv.h b/dlls/secur32/secur32_priv.h index 3254e0b..98b95c7 100644 --- a/dlls/secur32/secur32_priv.h +++ b/dlls/secur32/secur32_priv.h @@ -204,8 +204,8 @@ SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle) DECLSPEC_HIDDE SECURITY_STATUS SEC_ENTRY ntlm_MakeSignature(PCtxtHandle, ULONG, PSecBufferDesc, ULONG) DECLSPEC_HIDDEN; SECURITY_STATUS SEC_ENTRY ntlm_VerifySignature(PCtxtHandle, PSecBufferDesc, ULONG, PULONG) DECLSPEC_HIDDEN; -SecPkgInfoW *ntlm_package_infoW; -SecPkgInfoA *ntlm_package_infoA; +extern SecPkgInfoW *ntlm_package_infoW; +extern SecPkgInfoA *ntlm_package_infoA; /* schannel internal interface */ typedef struct schan_imp_session_opaque *schan_imp_session; diff --git a/dlls/twain_32/twain_i.h b/dlls/twain_32/twain_i.h index ffe6bd9..b36efd4 100644 --- a/dlls/twain_32/twain_i.h +++ b/dlls/twain_32/twain_i.h @@ -39,10 +39,10 @@ typedef struct tagActiveDS DSENTRYPROC dsEntry; } activeDS; -TW_UINT16 DSM_currentState DECLSPEC_HIDDEN; /* current state of Source Manager */ -TW_UINT16 DSM_twCC DECLSPEC_HIDDEN; /* current condition code of Source Manager */ +extern TW_UINT16 DSM_currentState DECLSPEC_HIDDEN; /* current state of Source Manager */ +extern TW_UINT16 DSM_twCC DECLSPEC_HIDDEN; /* current condition code of Source Manager */ -activeDS *activeSources DECLSPEC_HIDDEN; /* list of active data sources */ +extern activeDS *activeSources DECLSPEC_HIDDEN; /* list of active data sources */ /* Implementation of operation triplets (From Application to Source Manager) */ extern TW_UINT16 TWAIN_CloseDS diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 69b04e7..270528c 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -19,8 +19,8 @@ #include "wine/list.h" #include "wine/unicode.h" -IClientSecurity client_security; -struct list *table_list; +extern IClientSecurity client_security; +extern struct list *table_list; #define SIZEOF(array) (sizeof(array)/sizeof((array)[0])) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 128937a..88975fc 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -891,17 +891,17 @@ typedef struct __GLsync *GLsync; typedef char GLchar; #endif -void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN; -void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN; +extern void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN; +extern void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN; /* WGL functions */ -HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN; -BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN; -HGLRC (WINAPI *pwglGetCurrentContext)(void) DECLSPEC_HIDDEN; -HDC (WINAPI *pwglGetCurrentDC)(void) DECLSPEC_HIDDEN; -PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; -BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN; -BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN; +extern HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN; +extern BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN; +extern HGLRC (WINAPI *pwglGetCurrentContext)(void) DECLSPEC_HIDDEN; +extern HDC (WINAPI *pwglGetCurrentDC)(void) DECLSPEC_HIDDEN; +extern PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; +extern BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN; +extern BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN; #define WGL_FUNCS_GEN \ USE_WGL_FUNC(wglCreateContext) \ diff --git a/include/endpointvolume.idl b/include/endpointvolume.idl index f58450a..eaf4f8a 100644 --- a/include/endpointvolume.idl +++ b/include/endpointvolume.idl @@ -30,9 +30,9 @@ typedef struct AUDIO_VOLUME_NOTIFICATION_DATA cpp_quote("typedef struct AUDIO_VOLUME_NOTIFICATION_DATA *PAUDIO_VOLUME_NOTIFICATION_DATA;") -cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_VOLUME 0x1\n") -cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_MUTE 0x2\n") -cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_METER 0x4\n") +cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_VOLUME 0x1") +cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_MUTE 0x2") +cpp_quote("#define ENDPOINT_HARDWARE_SUPPORT_METER 0x4") interface IAudioEndpointVolumeCallback; interface IAudioEndpointVolume; diff --git a/include/gameux.idl b/include/gameux.idl index 31be9ca..da4fc54 100644 --- a/include/gameux.idl +++ b/include/gameux.idl @@ -42,7 +42,7 @@ library gameuxLib cpp_quote("#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL") cpp_quote("#define ID_ICON_ICO __ICON_ICO") - cpp_quote("#if defined(__GNUC__)") + cpp_quote("#if defined(__GNUC__) || defined(__TINYC__)") cpp_quote("#define ID_GDF_XML_STR (const WCHAR[]){'_','_','G','D','F','_','X','M','L',0}") cpp_quote("#define ID_GDF_THUMBNAIL_STR (const WCHAR[]){'_','_','G','D','F','_','T','H','U','M','B','N','A','I','L',0}") cpp_quote("#elif defined(_MSC_VER)") diff --git a/include/msvcrt/crtdefs.h b/include/msvcrt/crtdefs.h index 06ce9c3..c89d909 100644 --- a/include/msvcrt/crtdefs.h +++ b/include/msvcrt/crtdefs.h @@ -51,6 +51,8 @@ # endif # elif defined(_MSC_VER) /* Nothing needs to be done. __stdcall already exists */ +# elif defined(__TINYC__) +# define __stdcall __attribute__((__stdcall__)) # else # error You need to define __stdcall for your compiler # endif diff --git a/include/windef.h b/include/windef.h index 9cf98e7..22cf5d6 100644 --- a/include/windef.h +++ b/include/windef.h @@ -52,7 +52,7 @@ extern "C" { #ifndef __stdcall # ifdef __i386__ -# ifdef __GNUC__ +# if defined (__GNUC__) # ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */ # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__)) # else @@ -60,6 +60,8 @@ extern "C" { # endif # elif defined(_MSC_VER) /* Nothing needs to be done. __stdcall already exists */ +# elif defined(__TINYC__) +# define __stdcall __attribute__((__stdcall__)) # else # error You need to define __stdcall for your compiler # endif diff --git a/include/winnt.h b/include/winnt.h index 5625e37..0efdf8a 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -65,6 +65,10 @@ extern "C" { # endif #endif +#ifndef DECLSPEC_HOTPATCH +# define DECLSPEC_HOTPATCH +#endif + #ifndef DECLSPEC_ALIGN # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) # define DECLSPEC_ALIGN(x) __declspec(align(x)) diff --git a/include/winsvc.h b/include/winsvc.h index c1af509..0b9b423 100644 --- a/include/winsvc.h +++ b/include/winsvc.h @@ -33,7 +33,7 @@ extern "C" { #define SERVICES_ACTIVE_DATABASEA "ServicesActive" #define SERVICES_FAILED_DATABASEA "ServicesFailed" -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__TINYC__) # define SERVICES_ACTIVE_DATABASEW (const WCHAR []){ 'S','e','r','v','i','c','e','s','A','c','t','i','v','e',0 } # define SERVICES_FAILED_DATABASEW (const WCHAR []){ 'S','e','r','v','i','c','e','s','F','a','i','l','e','d',0 } #elif defined(_MSC_VER) diff --git a/libs/wine/port.c b/libs/wine/port.c index 8e8caf8..0c021b7 100644 --- a/libs/wine/port.c +++ b/libs/wine/port.c @@ -67,7 +67,7 @@ void DECLSPEC_NORETURN wine_switch_to_stack( void (*func)(void *), void *arg, vo * Switch to the specified stack to call the function and return. */ -#if defined(__i386__) && defined(__GNUC__) +#if defined(__i386__) && ( defined(__GNUC__) || defined(__TINYC__)) __ASM_GLOBAL_FUNC( wine_call_on_stack, "pushl %ebp\n\t" __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 74dcc40..709ee82 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -447,7 +447,7 @@ void stack_backtrace(DWORD tid) /* backtrace every thread in every process except the debugger itself, * invoking via "bt all" */ - if (tid == -1) return backtrace_all(); + if (tid == -1) return; if (!dbg_curr_process) { diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 280bd05..e879bad 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2343,7 +2343,7 @@ static void write_array_element_type(FILE *file, const type_t *type, return; } } - return write_member_type(file, type, cont_is_complex, NULL, elem, NULL, tfsoff); + //return write_member_type(file, type, cont_is_complex, NULL, elem, NULL, tfsoff); } static void write_end(FILE *file, unsigned int *tfsoff) diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 416f81d..19cb9d3 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -2027,7 +2027,10 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) } if (is_attr(interface->attrs, ATTR_DISPINTERFACE)) - return add_dispinterface_typeinfo(typelib, interface); + { + add_dispinterface_typeinfo(typelib, interface); + return; + } /* midl adds the parent interface first, unless the parent itself has no parent (i.e. it stops before IUnknown). */
_______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel