21 Commits

Author SHA1 Message Date
Bart Van Assche
5e6f6ec5ed MinGW: Second step of porting to MinGW 2021-07-18 20:13:03 -07:00
Bart Van Assche
70759869ff Port to MinGW
Compile-tested only.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 13:23:52 -07:00
Bart Van Assche
ca9c585ef6 win32/win32_compat.c: Reformat this file
This file has been reformatted with clang-format --style=file and the Linux
kernel .clang-format style file.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 13:23:52 -07:00
Bart Van Assche
2a5a0b3291 Enable -Wno-unused-parameter
Instead of adding __attribute__((unused)) to unused arguments, add the
-Wno-unused-parameter compiler flag.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 13:23:41 -07:00
Bart Van Assche
ea6b2282d4 Use __attribute__((format(printf, ...))) directly
Instead of defining the macro _R_(), define __attribute__() as a macro for
compilers that do not support __attribute__(), namely Microsoft Visual
Studio.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 11:52:40 -07:00
Tim Crawford
aba0f7da1a Replace WIN32 with _WIN32
Using WIN32 depends on the build environment defining the variable.
_WIN32 is a predefined MSVC macro and is always available.

Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
2017-11-29 10:07:44 -05:00
Tim Crawford
cdb437c545 Fix compilation with VS2017
The primary issue is that in MSVC 14.00 (VS2015) Microsoft added
snprintf as a function to the standard library and prevents users from
defining it to something else (typically, this was _snprintf). So, only
define it when using _MSC_VER < 1900.

Other changes are:
- Fix macro definition of dup2
- Add macro for getpid
- Add function definition for win32_dup
- Add missing EXTERNs

Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
2017-11-29 10:07:44 -05:00
Ronnie Sahlberg
446a0f5d2f WIN32: Make dup2 a NO-OP under win32.
There is something wrong with dup2 under win32 and I do not know win32
well enough to fix it, thus this workaround.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-14 08:25:39 -07:00
Ronnie Sahlberg
64ffae4062 WIN32: Use send/recv instead of read/write
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-14 08:25:38 -07:00
Ronnie Sahlberg
12222077cc Add project file for iscsi-ls and make it build under visual studio
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-13 12:09:42 -07:00
Ronnie Sahlberg
f750101980 Add initial visual studio project files and fix the win32 build
Win32 has been rotting for a while. This patch adds vs17 build files
as well as fixing up all build errors that have accumulated.
There are still build warnings but those can be addressed in a followup
patch.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-11 21:19:14 -07:00
Ronnie Sahlberg
dfdf2091d4 typo 2013-10-05 17:25:06 -07:00
Ronnie Sahlberg
305d6e1644 Get rid of a lot of WIN32 ifdefs by providing a compatibility function instead 2013-10-05 17:23:46 -07:00
Ronnie Sahlberg
d7b7c7727a Fix win32 so it works again 2013-10-05 15:34:56 -07:00
Peter Lieven
b1374b42ed Rename scsi-command.c to iscsi-command.c 2012-11-12 16:12:29 +01:00
Ronnie Sahlberg
db8dadab21 win32 updat ethe example app iscsiclient to compile and link with the compatibility functions 2012-05-15 21:59:59 +10:00
Ronnie Sahlberg
e4739d639f win32: build the library with win32_compat functions and also link the dll with kernel32 to get Sleep() 2012-05-15 21:57:05 +10:00
Ronnie Sahlberg
7215a917f2 win32: create a compatibility macro for sleep() 2012-05-15 21:49:29 +10:00
Ronnie Sahlberg
6c23b6acc1 win32: remove some definitions we dont need in the win32 compatibility header 2012-05-15 21:47:45 +10:00
Ronnie Sahlberg
bd48629c8b W32: copy the compatibility functions for poll (and some others) from libnfs so win32 can use a porper poll emulation in the future. 2012-05-13 16:48:50 +10:00
Ronnie Sahlberg
c3d3123981 Windows: Add support to build as a DLL under windows 2011-08-31 13:12:30 +10:00