Closed tibotix closed 2 years ago
awesome. instead of a seperate makefile you can have a look at how we handle different archs/os in a sister projects makefile: https://github.com/stef/libsphinx/blob/master/src/makefile
and maybe call the target mingw instead of windows, maybe someone comes along and adds a visualc port or so...
btw the fcntl
s are used for checking if a filedescriptor is open/exists, if you know a replacement for that in mingw perhaps?
As far as I know, MinGW has a _fstat
function that expects an open file descriptor and some buffer and returns -1
if the file status information could not be obtained and 0
if it could be obtained. maybe this is useful...
I changed utils/main.c
to use the _fstat
function. It now compiles under MinGW and runs. However i have not checked the functionality of the WindowsAPI call yet.
love it! are you sure you're only 18?
btw also added a note to the main readme about your dart binding...
Ah Perfect , thanks. I also plan to publish the dart bindings on pub.dev btw . And yeah haha I am sure I’m only 18 :) started really early with programming and stuff …
To compile libopaque on windows with MinGW, the following steps had to be done:
aux
directory toaux_
, as AUX is a reserved file/directory name in Windows.-z relro
does not exist in MinGW) , changes SOEXT to dll and add a linker flag to link agains-lws2_32
(winsocks2 lib)opaque.c
to conditionally includewinsock2.h
instead ofarpa/inet.h
for the htons functionThings that do not compile under Windows are:
utils/main.c
executable, as it uses some specificfcntl()
calls that do not exist in windows.Note that iam not very familiar with the linker options provided by MinGW and which one is responsible for extra security features. However, this is the output of winchecksec against the compiled
libopaque.dll
lib: