在 2019/2/28 4:25, Ruslan Garipov 写道:
>> it does apply cleanly to the master branch.
>> Please rebase this work against master
> 
> I believe the issue here is not the master's tip.  That's line-ending
> issue.
> 

Yes killing all CRs makes the patch apply again.

But this is unusual. Git should be able to ignore CRs before LFs.  :|

> 
> Thanks a lot!  I'll add your fix to the next version of the patch.  But
> I also didn't tested it because I have no i686-w64-mingw32 toolset.
> This is actually the reason why I didn't create the DEF file for x86
> library by myself.
> 
> Thanks a lot for review.  I will send the new patch by the next message.
> Hope it could be applied well.
> 

The proposed patch contains an error when compiled as C++:

> +struct SSVARIANT {
> +  SSVARTYPE vt;
> +  DWORD dwReserved1;
> +  DWORD dwReserved2;
> +  union {
> +    BYTE bTinyIntVal;
> +    SHORT sShortIntVal;
> +    LONG lIntVal;
> +    LONGLONG llBigIntVal;
> +    FLOAT fltRealVal;
> +    DOUBLE dblFloatVal;
> +    CY cyMoneyVal;
> +    VARIANT_BOOL fBitVal;
> +    BYTE rgbGuidVal[16];
> +    DB_NUMERIC numNumericVal;
> +    DBDATE dDateVal;
> +    DBTIMESTAMP tsDateTimeVal;
> +    struct _Time2Val {
> +      DBTIME2 tTime2Val;
> +      BYTE bScale;
> +    } Time2Val;

The `_Time2Val` (with a few more) would be invalid C++, as follows:

```
$ g++ -std=gnu++11 -Wall -Wextra -x c++
mingw-w64-headers/include/msoledbsql.h  -o /dev/null
mingw-w64-headers/include/msoledbsql.h:367:12: error: 'struct
SSVARIANT::<unnamed union>::_DateTimeVal' invalid; an anonymous union
may only have public non-static data members [-fpermissive]
     struct _DateTimeVal {
            ^~~~~~~~~~~~
```

This could be fixed by defining the struct inside `SSVARIANT` directly,
as follows:

```
struct SSVARIANT {
  SSVARTYPE vt;
  DWORD dwReserved1;
  DWORD dwReserved2;
  struct _Time2Val {
    DBTIME2 tTime2Val;
    BYTE bScale;
  };
  union {
    BYTE bTinyIntVal;
    SHORT sShortIntVal;
    LONG lIntVal;
    LONGLONG llBigIntVal;
    FLOAT fltRealVal;
    DOUBLE dblFloatVal;
    CY cyMoneyVal;
    VARIANT_BOOL fBitVal;
    BYTE rgbGuidVal[16];
    DB_NUMERIC numNumericVal;
    DBDATE dDateVal;
    DBTIMESTAMP tsDateTimeVal;
    struct _Time2Val Time2Val;
```

So, please fix this issue and send a new patch.


-- 
Best regards,
LH_Mouse

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to