Closed mrkskwsnck closed 3 years ago
@daurnimator The function htonll
is not defined with MinGW64 and GCC, so I implemented the latter alternative.
@MrksKwsnck can you confirm the current code works with both mingw and msvc?
Otherwise, could you remove your redundant commits from this PR?
Unfortunately, it does not compile using MSVC :-(
C:\luapgsql>cl /nologo /MD /O2 -c -Foluapgsql.obj -IC:/lua/include luapgsql.c -IC:\pgsql\include
luapgsql.c
luapgsql.c(194): warning C4090: "Funktion": Unterschiedliche "const"-Qualifizierer
C:\luapgsql>link -dll -def:pgsql.def -out:pgsql.dll C:/lua/lua53.dll luapgsql.obj -libpath:C:\pgsql/lib pq.lib
Microsoft (R) Incremental Linker Version 14.11.25547.0
Copyright (C) Microsoft Corporation. All rights reserved.
C:/lua/lua53.dll : fatal error LNK1107: Ungültige oder beschädigte Datei: Lesen bei 0x430 nicht möglich.
I tried compiling using Microsoft Visual Studio Build Tools 2017. As I am not experienced in working with MSVC, I need to investigate the issue.
Some time has passed and what I have managed so far is to successfully compile using MSVC (Microsoft Visual Studio Build Tools 2017). However, I still was not able to test the resulting DLL file properly, because it lacks some more dependencies (also the Dependency Walker was not helpful here).
Sorry for not acting on this earlier, but it looks your diff does not apply anymore. Please re-submit agains current sources if windows support is still wanted.
The compiler used was GCC from the MinGW64 toolchain. The method used to switch endianness is defined in ia32intrin.h but called through x86intrin.h headers.