Start adding MSVC 2003 target

This commit is contained in:
twinaphex 2017-12-25 04:29:57 +01:00
parent 5eb5dee191
commit c781348305
4 changed files with 42 additions and 11 deletions

View File

@ -388,6 +388,26 @@ CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
LIBS =
WINDOWS_VERSION=1
# Windows MSVC 2003 x86
else ifeq ($(platform), windows_msvc2003_x86)
CC = cl.exe
CXX = cl.exe
PATH := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/bin"):$(PATH)
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../IDE")
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/include")
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS71COMNTOOLS)../../Vc7/lib")
BIN := $(shell IFS=$$'\n'; cygpath "$(VS71COMNTOOLS)../../Vc7/bin")
WindowsSdkDir := $(INETSDK)
export INCLUDE := $(INCLUDE);$(INETSDK)/Include;libretro-common/include/compat/msvc
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2
LDFLAGS += -DLL
CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
# Windows
else
TARGET := $(TARGET_NAME)_libretro.dll

View File

@ -39,7 +39,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER > 1310
# include <intrin.h> /* for __cpuid() and _xgetbv() */
#endif
@ -50,13 +50,12 @@
#ifdef DEBUG
#include <stdio.h>
#define dfprintf fprintf
#else
/* This is bad practice, it should be a static void empty function */
#define dfprintf(file, format, ...)
static int dfprintf(FILE *stream, const char *format, ...)
{
}
#endif
#if defined FLAC__CPU_IA32
/* these are flags in EDX of CPUID AX=00000001 */
static const unsigned FLAC__CPUINFO_IA32_CPUID_CMOV = 0x00008000;
@ -138,6 +137,7 @@ ia32_cpu_info (FLAC__CPUInfo *info)
info->ia32.avx2 = (flags_ebx & FLAC__CPUINFO_IA32_CPUID_AVX2 ) ? true : false;
}
#ifdef DEBUG
dfprintf(stderr, "CPU info (IA-32):\n");
dfprintf(stderr, " CMOV ....... %c\n", info->ia32.cmov ? 'Y' : 'n');
dfprintf(stderr, " MMX ........ %c\n", info->ia32.mmx ? 'Y' : 'n');
@ -153,6 +153,7 @@ ia32_cpu_info (FLAC__CPUInfo *info)
dfprintf(stderr, " FMA ........ %c\n", info->ia32.fma ? 'Y' : 'n');
dfprintf(stderr, " AVX2 ....... %c\n", info->ia32.avx2 ? 'Y' : 'n');
}
#endif
/*
* now have to check for OS support of AVX instructions
@ -164,9 +165,11 @@ ia32_cpu_info (FLAC__CPUInfo *info)
info->ia32.fma = false;
}
if (FLAC__HAS_X86INTRIN && FLAC__AVX_SUPPORTED) {
#ifdef DEBUG
if (FLAC__HAS_X86INTRIN && FLAC__AVX_SUPPORTED)
dfprintf(stderr, " AVX OS sup . %c\n", info->ia32.avx ? 'Y' : 'n');
}
#endif
#else
info->use_asm = false;
#endif
@ -199,6 +202,7 @@ x86_64_cpu_info (FLAC__CPUInfo *info)
info->x86.avx2 = (flags_ebx & FLAC__CPUINFO_IA32_CPUID_AVX2 ) ? true : false;
}
#ifdef DEBUG
dfprintf(stderr, "CPU info (x86-64):\n");
dfprintf(stderr, " SSE3 ....... %c\n", info->x86.sse3 ? 'Y' : 'n');
dfprintf(stderr, " SSSE3 ...... %c\n", info->x86.ssse3 ? 'Y' : 'n');
@ -210,6 +214,7 @@ x86_64_cpu_info (FLAC__CPUInfo *info)
dfprintf(stderr, " FMA ........ %c\n", info->x86.fma ? 'Y' : 'n');
dfprintf(stderr, " AVX2 ....... %c\n", info->x86.avx2 ? 'Y' : 'n');
}
#endif
/*
* now have to check for OS support of AVX instructions
@ -221,9 +226,11 @@ x86_64_cpu_info (FLAC__CPUInfo *info)
info->x86.fma = false;
}
if (FLAC__AVX_SUPPORTED) {
#ifdef DEBUG
if (FLAC__AVX_SUPPORTED)
dfprintf(stderr, " AVX OS sup . %c\n", info->x86.avx ? 'Y' : 'n');
}
#endif
#else
/* Silence compiler warnings. */
(void) info;

View File

@ -38,7 +38,7 @@
#include "share/compat.h"
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER > 1310
#include <intrin.h> /* for _BitScanReverse* */
#endif

View File

@ -3316,7 +3316,11 @@ local_snprintf(char *str, size_t size, const char *fmt, ...)
va_start (va, fmt);
#if defined _MSC_VER
#if defined _MSC_VER && _MSC_VER == 1310
rc = _vsnprintf(str, size, fmt, va);
if (rc < 0)
rc = size - 1;
#elif defined _MSC_VER
rc = vsnprintf_s (str, size, _TRUNCATE, fmt, va);
if (rc < 0)
rc = size - 1;