trunk broken on Windows

Bug #836853 reported by Vladislav Vaintroub on 2011-08-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysbench
Status tracked in Trunk
0.4
Undecided
Alexey Kopytov
Trunk
Undecided
Alexey Kopytov

Bug Description

Current sysbench does not compile on Windows, due to the use of off_t without appropriate header, C99 round() function, and using "inline" in plain C code. Additionally, if the above is fixed, db_reset_stats() would overwrite already initialized critical sections with all zeros, and this would result in crashes at runtime

Related branches

please find fixes in the attachment

Alexey Kopytov (akopytov) wrote :

Wlad,

Thank you for the patch. One thing is not quite clear to me though:

so sb_timer_update() is defined with 'inline' which appears to be a problem on Windows, where '__inline' must be used instead. But sb_win.h redefines 'inline' to address this problem:

#ifndef __cplusplus
#ifndef inline
#define inline __inline
#endif
#endif

And sb_win.h is included from sb_timer.h which in turn is included from sb_timer.c. So it looks like that should _not_ be a problem after all. Can you clarify please?

>But sb_win.h redefines 'inline' to address this problem:
Does not seem to be here:
http://bazaar.launchpad.net/~sysbench-developers/sysbench/0.5/view/head:/sysbench/sb_win.h

If I look for "inline" in this file, the only thing I find is a usage of VC++-compatible __inline in

static __inline int usleep(int micros)

On 26.09.11 14:32, Vladislav Vaintroub wrote:
>> But sb_win.h redefines 'inline' to address this problem:
> Does not seem to be here:
> http://bazaar.launchpad.net/~sysbench-developers/sysbench/0.5/view/head:/sysbench/sb_win.h
>
> If I look for "inline" in this file, the only thing I find is a usage
> of VC++-compatible __inline in
>
> static __inline int usleep(int micros)
>

Doh, I was looking at sysbench 0.4:
http://bazaar.launchpad.net/~sysbench-developers/sysbench/0.4/view/head:/sysbench/sb_win.h#L36

So I guess it is sufficient to just port that part to 0.5 to fix the
'inline' problem?

Yep, this would do the trick

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers