Hash :
dcab56a1
        
        Author :
  
        
        Date :
2017-01-05T14:47:34
        
      
Move some file utils to common. Since common is shared through all ANGLE code (libANGLE/tests/samples) this is the most general place for these utils, and will give libANGLE access to them. We'll need them to get the current executable dir for loading the Vulkan layers. This also means we'll need to fix the global static variable use when we have the ability. BUG=angleproject:1319 BUG=chromium:677841 Change-Id: I7af61920635135b28a2f02f4a8d019ee88c9dd28 Reviewed-on: https://chromium-review.googlesource.com/425440 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Windows_system_utils.cpp: Implementation of OS-specific functions for Windows
#include "system_utils.h"
#include <stdarg.h>
#include <windows.h>
#include <array>
#include <vector>
namespace angle
{
void Sleep(unsigned int milliseconds)
{
    ::Sleep(static_cast<DWORD>(milliseconds));
}
void WriteDebugMessage(const char *format, ...)
{
    va_list args;
    va_start(args, format);
    int size = vsnprintf(nullptr, 0, format, args);
    va_end(args);
    std::vector<char> buffer(size + 2);
    va_start(args, format);
    vsnprintf(buffer.data(), size + 1, format, args);
    va_end(args);
    OutputDebugStringA(buffer.data());
}
}  // namespace angle