ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

improvement for Win32 compilation #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a very minor feature request. I'd like to use Mongoose in a 
Windows-targeting project that uses __stdcall convention as the default 
one. Under this setup Mongoose cannot compile because qsort requires a 
__cdecl callback.

What steps will reproduce the problem?
1. Compile with 32-bit Microsoft compiler for Windows
2. use __stdcall calling convention as the default one for the project

What is the expected output? What do you see instead?

mongoose\mongoose.c(2683) : error C2440: 'function' : cannot convert from 
'int (__stdcall *)(const void *,const void *)' to 'int (__cdecl *)(const 
void *,const void *)'

What version of the product are you using? On what operating system?

mongoose.c 446 2009-07-08 21:06:56Z valenok for 32-bit Windows with Visual 
Studio 2008 compiler (compiler version 15.0)

Please provide any additional information below.

If possible, change the definition of compare_dir_entries to

static int 
#ifdef _MSC_VER 
__cdecl
#endif
compare_dir_entries(const void *p1, const void *p2)

Thanks!

Original issue reported on code.google.com by teobugsl...@gmail.com on 18 Mar 2010 at 11:24

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 7 Sep 2010 at 7:20