trunk broken on Windows

Bug #836853 reported by Vladislav Vaintroub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysbench
Status tracked in Trunk
0.4
Fix Committed
Undecided
Alexey Kopytov
Trunk
Fix Committed
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

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

please find fixes in the attachment

Revision history for this message
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?

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) 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)

Revision history for this message
Alexey Kopytov (akopytov) wrote : Re: [Bug 836853] Re: trunk broken on Windows

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?

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

Yep, this would do the trick

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.