Oops! I'm really sorry, I've messed up the patch... I'll resend it in a few minutes. Sorry.

On March 7, 2019 9:25:22 AM Ruslan Garipov <ruslanngari...@gmail.com> wrote:

In August of 2011[1] Microsoft announced deprecation of the Microsoft
OLE DB Provider for SQL Server.  But in October of 2017 Microsoft had to
undeprecate[2] OLE DB data access technology releasing the ``Microsoft
OLE DB Driver for SQL Server'' known as ``msoledbsql''.

This commit adds the ``msoledbsql'' API to mingw-w64 -- the only OLE DB
data access solution supported and maintained by Microsoft now.

To provide class and interface identifiers msoledbsql.h in this commit
uses the same technique as, for example, mingw-w64's sqloledb.h file,
i.e. it uses the `DBINITCONSTANTS` guard to define identifiers only in
one module.  Original Microsoft's files (both msoledbsql.h from the new
API and sqloledb.h from Microsoft Windows 10 SDK) use
`__declspec(selectany)` to move that "burden" to the linker.

The original Microsoft's msoledbsql.h uses a Microsoft-specific
"extension", which allows Microsoft Visual C++ compiler to ignore the
following paragraph of the Standard for programming language C++:

10.4.1 Anonymous unions [class.union.anon]
1 ... Each member-declaration in the member-specification of an
anonymous union shall either define a non-static data member or be a
static_assert-declaration. [Note: Nested types, anonymous unions, and
functions cannot be declared within an anonymous union.  —end note]

and successfully compile a code like this:

```
struct SSVARIANT
{
  union
  {
    struct _Time2Val
    {
    } Time2Val;
  };
};
```

GNU C++ and clang++ aren't compatible with such behavior.  Moreover,
those compilers don't allow `typedef`s within anonymous unions (again
because of the [class.union.anon]).  Therefore, I have to break public
API of the original header file related to the `SSVARIANT` structure
type.

Review log: https://sf.net/p/mingw-w64/mailman/mingw-w64-public/thread/
9754bd81-b475-728f-79ce-10e626757a17%40gmail.com/.

[1]: https://blogs.msdn.microsoft.com/sqlnativeclient/2011/08/29/
microsoft-is-aligning-with-odbc-for-native-relational-data-access/
[2]: https://blogs.msdn.microsoft.com/sqlnativeclient/2017/10/06/
announcing-the-new-release-of-ole-db-driver-for-sql-server/

Signed-off-by: Ruslan Garipov <ruslanngari...@gmail.com>
---
 mingw-w64-crt/Makefile.in              |    4 +-
 mingw-w64-crt/lib32/Makefile.am        |    1 +
 mingw-w64-crt/lib32/msoledbsql.def     |   13 +
 mingw-w64-crt/lib64/Makefile.am        |    1 +
 mingw-w64-crt/lib64/msoledbsql.def     |   13 +
 mingw-w64-headers/include/msoledbsql.h | 1454 ++++++++++++++++++++++++
 6 files changed, 1484 insertions(+), 2 deletions(-)
 create mode 100644 mingw-w64-crt/lib32/msoledbsql.def
 create mode 100644 mingw-w64-crt/lib64/msoledbsql.def
 create mode 100644 mingw-w64-headers/include/msoledbsql.h





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

Reply via email to