This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <intrin.h> | |
#include <stdio.h> | |
//#include <atomic> | |
// Set either of these to 1 to prevent CPU reordering | |
#define USE_CPU_FENCE 0 | |
#define USE_SINGLE_HW_THREAD 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wstring UTF8toUnicode(const string& s) | |
{ | |
wstring ws; | |
wchar_t wc; | |
for( int i = 0;i < s.length(); ) | |
{ | |
char c = s[i]; | |
if ( (c & 0x80) == 0 ) | |
{ | |
wc = c; |