Builtin slirp: compilation fixes for VS2019 and Cygwin.
- VS2019 needs C++20 standard to be set. - Some Cygwin related additions in util.cc. - slirp_ssize_t definition and usage fixed. - changed include position of compat.h in slirp.h.
This commit is contained in:
parent
971576e32f
commit
c5fd56558f
@ -20,6 +20,7 @@
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9EFB2055-35E8-42E9-A274-F4987CB2A655}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
@ -140,6 +141,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<CallingConvention>FastCall</CallingConvention>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
1
bochs/configure
vendored
1
bochs/configure
vendored
@ -26536,6 +26536,7 @@ case "$target" in
|
||||
else
|
||||
C_OPT="$C_OPT /EHs-c-"
|
||||
fi
|
||||
C_OPT="$C_OPT /std:c++20"
|
||||
if test "$bx_plugins" = 1; then
|
||||
CFLAGS="/nologo /MD /W3 /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS $C_OPT"
|
||||
else
|
||||
|
@ -2907,6 +2907,7 @@ case "$target" in
|
||||
else
|
||||
C_OPT="$C_OPT /EHs-c-"
|
||||
fi
|
||||
C_OPT="$C_OPT /std:c++20"
|
||||
if test "$bx_plugins" = 1; then
|
||||
CFLAGS="/nologo /MD /W3 /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS $C_OPT"
|
||||
else
|
||||
|
@ -113,7 +113,7 @@ protected:
|
||||
} bx_slirp_match;
|
||||
|
||||
|
||||
static ssize_t send_packet(const void *buf, size_t len, void *opaque)
|
||||
static slirp_ssize_t send_packet(const void *buf, size_t len, void *opaque)
|
||||
{
|
||||
bx_slirp_pktmover_c *class_ptr = (bx_slirp_pktmover_c *)opaque;
|
||||
|
||||
|
@ -6,11 +6,12 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
typedef Bit64s slirp_ssize_t;
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
typedef ssize_t slirp_ssize_t;
|
||||
#endif
|
||||
|
||||
struct Slirp;
|
||||
typedef struct Slirp Slirp;
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "slirp_config.h"
|
||||
#include "compat.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@ -152,6 +151,8 @@ void free(void *ptr);
|
||||
#include <sys/stropts.h>
|
||||
#endif
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
|
||||
|
@ -26,11 +26,17 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#ifdef __CYGWIN__
|
||||
#define __USE_W32_SOCKETS
|
||||
#define _WIN32
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "util.h"
|
||||
|
||||
#if BX_NETWORKING && BX_NETMOD_SLIRP
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@ -174,7 +180,11 @@ static int socket_error(void)
|
||||
int slirp_ioctlsocket_wrap(int fd, int req, void *val)
|
||||
{
|
||||
int ret;
|
||||
#ifdef __CYGWIN__
|
||||
ret = ioctlsocket(fd, req, (__ms_u_long*)val);
|
||||
#else
|
||||
ret = ioctlsocket(fd, req, (u_long*)val);
|
||||
#endif
|
||||
if (ret < 0) {
|
||||
errno = socket_error();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user