[x264-devel] Re: bug in commit 607

Måns Rullgård mru at inprovide.com
Sat Dec 16 14:54:17 CET 2006


Enzo <v.deflorio at katamail.com> writes:

> Måns Rullgård ha scritto:
>> Enzo <v.deflorio at katamail.com> writes:
>>
>>   
>>> Dear sirs,
>>>
>>> I have successfully compiled x264-snapshot-20061215-2245.tar.bz2 on my
>>> Win32/cygwin system. Then I svn'd the latest version (611) and
>>> experienced the following problem:
>>>
>>> gcc -O4 -ffast-math -Wall -I. -D__X264__ -DHAVE_MMXEXT -DHAVE_SSE2
>>> -DARCH_X86 -DSYS_CYGWIN -s -fomit-frame-pointer   -c -o common/set.o
>>> common/set.c
>>> In file included from /usr/include/sys/types.h:373,
>>>                  from /usr/include/stdio.h:46,
>>>                  from common/set.c:24:
>>> /usr/include/cygwin/types.h:211: error: parse error before "int"
>>> /usr/include/cygwin/types.h:212: error: parse error before "int"
>>> /usr/include/cygwin/types.h:218: error: parse error before "int"
>>> make: *** [common/set.o] Error 1
>>>     
>>
>> Please post lines 200--220 of that file.
>>
>>   
> Please find them herein:
>
>     typedef char *addr_t;
>     #endif
>
>     #ifndef __mode_t_defined
>     #define __mode_t_defined
>     typedef unsigned mode_t;
>     #endif
>     #endif /*__BIT_TYPES_DEFINED*/
>
>     #if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)
>
>     typedef struct __pthread_t {char __dummy;} *pthread_t;
>     typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t;
>
>     typedef struct __pthread_key_t {char __dummy;} *pthread_key_t;
>     typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t;
>     typedef struct __pthread_mutexattr_t {char __dummy;}
>     *pthread_mutexattr_t;
>     typedef struct __pthread_condattr_t {char __dummy;} *pthread_condattr_t;
>     typedef struct __pthread_cond_t {char __dummy;} *pthread_cond_t;
>
>       /* These variables are not user alterable. This means you!. */
>
>     (line 211 is "typedef struct __pthread_t {char __dummy;} *pthread_t;")

The problem is with the pthread stuff at line 48 and following in
common/common.h, specifically the #define pthread_t int and similar
lines.  This whole chunk looks very dodgy to me.  Redefining system
symbols is never a good idea.

Loren, what's the deal with this?  What's the purpose of the
USE_CONDITION_VAR thing, and why is it only defined on windows?
Instead of #defining pthread_t and friends, typedefing x264_thread_t
etc depending on the system should be safer.

-- 
Måns Rullgård
mru at inprovide.com

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list