Remove more unused stuff from win64.mak
Remove unused NDEBUG and PSQLODBC_EXPORTS defines from makefiles.
Fix crash if connection is closed while sending a query to the server.

This is a similar bug that was fixed in commit 22b151eb. Some functions
reset conn->sock to NULL on a socket error, so we must not keep a copy of
it in a local variable. Also, SOCK_get_id should check for NULL argument
like all the rest of the SOCK_get/put_* functions.
Misc whitespace and comment fixes. Remove dead, commented-out code.

For sake of readability.
Minor code cleanup.

The main change is to move the responsibility of adding the "length" header
to the QueryBuild from ResolveOneParam to its caller, when constructing the
parameters to send over to the server in a Bind message. ResolveOneParam
is complicated enough without that, so it seems more clear this way.

The rest is just fixes to the macros to make them deal with a "&qb" argument,
by adding parens around the macro argument. And while at it, clean up the
whitespace in them.
Rewrite the conversion functions between strings and SQL_NUMERIC_STRUCT.

Aside from making the functions more readable and faster, this fixes
a number of bugs:

1. When converting a large number from decimal to binary, the least
significant byte might be wrong (reported by Walter Couto)

2. In binary->decimal conversion, a number with small precision but large
scale caused a "Floating point exception".

3. In binary->decimal conversion, building the final string was wrong, picking
up "digits" from outside the reserved stack space, if scale was larger than 40

4. The param_string buffer allocated for the result of binary->decimal
conversion was too small.

Also add a test cases for all of these bugs.
Oops, forgot to git add some last-minute changes to the new regression test.
Silence compiler warnings from regression tests.

Three categories of warnings:

1. Missing return at end of main() function
2. Unused variables (copy-pasted from another test)
3. Data type mismatch in printfs, e.g. passing SQLULEN param to %d
Fix ODBC function escape for SPACE function.

Also add a regression test case for SPACE and a few other ODBC function
escapes.
Support running regression tests on Windows.

Some tests fail, and numeric test crashes for me, but at least it's
relatively easy to run the suite on Windows now.

Michael Paquier and me
Fix a PowerShell syntax error.
Also handle the case when GSSBINDIR parameter is given as an empty string in psqodbcm_cpu.wxs.
Changes by a patch and a request from Craig Ringer <craig@2ndquadrant.com>.
Applied a patch [ODBC] PATCH: WiX has moved.
Register 64bit XA DLL on installation per discussion with him.
Make sure that the psqlodbc ANSI driver is ODBC3.5.
Add top-level Windows makefile targets for building installers.

You can now do "nmake /f win64.mak world" to build both x86 and x64
versions of the installers in one command.
Fix potentially uninitialized local pointer access which causes
fatal compilation errors on vs2012/2013 reported by Craig Ringer.
It's safe to add this change in addition to the previous commit.
d0c993d3f6f0a4496a20486f2ec19b14591baba7
Author: U-Lenovo-PC\hiroshi <hiroshi@Lenovo-PC.(none)>
Date:   Sat Jun 14 21:53:57 2014 +0900

    Fix potentially uninitialized local pointer access which causes
    fatal compilation errors on vs2012/2013 reported by Craig Ringer.
Fix the warning MSB8028: The intermediate directory (..\x86_Unicode_Release\) contains files shared from another project (pgxalib.vcxproj).  This can lead to incorrect clean and rebuild behavior.
Document build outputs

The build didn't explain what went where, or what to do about dependencies.
Improve the docs to cover the topic.
Discuss issues with SDK support and installation
ctype_length() is missing the length for SQL_C_BIGINT and SQL_C_NUMERIC(patch by John Smith <nukemd@hotmail.com>).