stdafx_gui.h created, wx removed from stdafx.h

This commit is contained in:
Nekotekina 2014-08-29 02:49:26 +04:00
parent 693e7a38fa
commit 028ce2dd9f
45 changed files with 421 additions and 183 deletions

View file

@ -83,3 +83,14 @@ int clock_gettime(int foo, struct timespec *ts);
#define DWORD int32_t
#endif
#ifndef InterlockedCompareExchange
static __forceinline uint32_t InterlockedCompareExchange(volatile uint32_t* dest, uint32_t exch, uint32_t comp)
{
return _InterlockedCompareExchange((volatile long*)dest, exch, comp);
}
static __forceinline uint64_t InterlockedCompareExchange(volatile uint64_t* dest, uint64_t exch, uint64_t comp)
{
return _InterlockedCompareExchange64((volatile long long*)dest, exch, comp);
}
#endif

View file

@ -14,7 +14,11 @@ std::string fmt::FormatV(const char *fmt, va_list args)
for (;;)
{
std::vector<char> buffptr(length);
#if !defined(_MSC_VER)
size_t printlen = vsnprintf(buffptr.data(), length, fmt, args);
#else
size_t printlen = vsnprintf_s(buffptr.data(), length, length - 1, fmt, args);
#endif
if (printlen < length)
{
str = std::string(buffptr.data(), printlen);

View file

@ -1,4 +1,5 @@
#pragma once
#include <wx/string.h>
#if defined(_MSC_VER)
#define snprintf _snprintf
@ -111,10 +112,14 @@ namespace fmt{
for (;;)
{
std::vector<char> buffptr(length);
#if !defined(_MSC_VER)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-security"
size_t printlen = snprintf(buffptr.data(), length, fmt.c_str(), std::forward<Args>(parameters)...);
#pragma clang diagnostic pop
#else
size_t printlen = _snprintf_s(buffptr.data(), length, length - 1, fmt.c_str(), std::forward<Args>(parameters)...);
#endif
if (printlen < length)
{
str = string(buffptr.data(), printlen);

View file

@ -1,9 +1,13 @@
#include "stdafx.h"
#include "Log.h"
#include <wx/dir.h>
#include <wx/file.h>
#include <wx/filename.h>
#include "rFile.h"
#ifdef _WIN32
#include <Windows.h>
// Maybe in StrFmt?
std::wstring ConvertUTF8ToWString(const std::string &source) {
int len = (int)source.size();

View file

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <wx/msgdlg.h>
#include "rMsgBox.h"
#ifndef QT_UI

View file

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <wx/image.h>
#ifndef _WIN32
#include <dirent.h>