On 5/24/13 4:54 , "Stefan Hajnoczi" <stefa...@gmail.com> wrote:
>On Thu, May 23, 2013 at 06:36:35PM +0000, Tomoki Sekiyama wrote: >> On 5/23/13 8:22 , "Stefan Hajnoczi" <stefa...@gmail.com> wrote: >> >> >On Tue, May 21, 2013 at 11:33:52AM -0400, Tomoki Sekiyama wrote: >> >> diff --git a/qga/vss-win32.h b/qga/vss-win32.h >> >> new file mode 100644 >> >> index 0000000..7600087 >> >> --- /dev/null >> >> +++ b/qga/vss-win32.h >> >> @@ -0,0 +1,85 @@ >> >> +/* >> >> + * QEMU Guest Agent win32 VSS common declarations >> >> + * >> >> + * Copyright Hitachi Data Systems Corp. 2013 >> >> + * >> >> + * Authors: >> >> + * Tomoki Sekiyama <tomoki.sekiy...@hds.com> >> >> + * >> >> + * This work is licensed under the terms of the GNU GPL, version 2 >>or >> >>later. >> >> + * See the COPYING file in the top-level directory. >> >> + */ >> >> + >> >> +#ifndef VSS_WIN32_H >> >> +#define VSS_WIN32_H >> >> + >> >> +#define __MIDL_user_allocate_free_DEFINED__ >> >> +#include "config-host.h" >> >> +#include <windows.h> >> >> +#include <shlwapi.h> >> >> + >> >> +/* Reduce warnings to include vss.h */ >> >> +#define __in IN >> >> +#define __out OUT >> >> +#define __RPC_unique_pointer >> >> +#define __RPC_string >> >> +#define __RPC__deref_inout_opt >> >> +#define __RPC__out >> >> +#ifndef __RPC__out_ecount_part >> >> +#define __RPC__out_ecount_part(x, y) >> >> +#endif >> >> +#define _declspec(x) >> >> +#undef uuid >> >> +#define uuid(x) >> > >> >This looks hacky. Why are you stubbing out macros that vss.h uses? >> >> Because these macros are internally defined/used by windows SDK's >> headers and not fully covered by mingw (some of them is only >> meaningful with Microsoft IDE), so it don't compile without >> these define's. >> >> This could be better if mingw supports these VSS headers, but >> I have no idea how to achieve that... > >Please add a comment explaining this. OK. >BTW, did you look at the macro definitions to see if they define >anything important? In other words, is there a difference when compiled >using Visual C++ where the macros actually have meaning? > >Stefan They are just annotating for compiler to warn things like "this shouldn't be NULL', or to give a hint to code generators. I believe they don't affect compiled executable binaries. Thanks, Tomoki Sekiyama