diff options
author | 2016-03-12 12:31:13 +0100 | |
---|---|---|
committer | 2016-03-12 12:31:13 +0100 | |
commit | a026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (patch) | |
tree | e31573822f2359677de519f9f3b600d98e8764cd /src/osd/windows | |
parent | 477d2abd43984f076b7e45f5527591fa8fd0d241 (diff) | |
parent | dcab55bf53b94713a6f72e9633f5101c8dd6c08c (diff) |
Merge pull request #15 from mamedev/master
Sync to base master
Diffstat (limited to 'src/osd/windows')
-rw-r--r-- | src/osd/windows/window.cpp | 5 | ||||
-rw-r--r-- | src/osd/windows/winfile.cpp | 13 | ||||
-rw-r--r-- | src/osd/windows/winutil.cpp | 8 | ||||
-rw-r--r-- | src/osd/windows/winutil.h | 22 |
4 files changed, 31 insertions, 17 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 52d0a898df7..326e8248bab 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -12,7 +12,6 @@ // Needed for RAW Input #define WM_INPUT 0x00FF -#include <stdio.h> // must be here otherwise issues with I64FMT in MINGW // standard C headers #include <process.h> @@ -152,7 +151,7 @@ static void mtlog_dump(void) for (i = 0; i < mtlogindex; i++) { osd_ticks_t curr = mtlog[i].timestamp * 1000000 / cps; - fprintf(f, "%20" I64FMT "d %10" I64FMT "d %s\n", (UINT64)curr, (UINT64)(curr - last), mtlog[i].event); + fprintf(f, "%s",string_format("%20I64d %10I64d %s\n", (UINT64)curr, (UINT64)(curr - last), mtlog[i].event).c_str()); last = curr; } fclose(f); @@ -174,7 +173,7 @@ bool windows_osd_interface::window_init() size_t temp; // determine if we are using multithreading or not - multithreading_enabled = downcast<windows_options &>(machine().options()).multithreading(); + multithreading_enabled = false;//downcast<windows_options &>(machine().options()).multithreading(); // get the main thread ID before anything else main_threadid = GetCurrentThreadId(); diff --git a/src/osd/windows/winfile.cpp b/src/osd/windows/winfile.cpp index e8fcc30ab2c..742f97363d6 100644 --- a/src/osd/windows/winfile.cpp +++ b/src/osd/windows/winfile.cpp @@ -290,19 +290,6 @@ file_error osd_fflush(osd_file *file) if (!file || !file->handle) return FILERR_FAILURE; - switch (file->type) - { - case WINFILE_FILE: - // attempt to flush file buffers - if (!FlushFileBuffers(file->handle)) - return win_error_to_mame_file_error(GetLastError()); - break; - case WINFILE_SOCKET: - return FILERR_FAILURE; - case WINFILE_PTTY: - return FILERR_FAILURE; - - } return FILERR_NONE; } diff --git a/src/osd/windows/winutil.cpp b/src/osd/windows/winutil.cpp index fe835301907..eb63eecacd0 100644 --- a/src/osd/windows/winutil.cpp +++ b/src/osd/windows/winutil.cpp @@ -160,7 +160,7 @@ lazy_loaded_function::lazy_loaded_function(const char * name, const wchar_t* dll } lazy_loaded_function::lazy_loaded_function(const char * name, const wchar_t** dll_names, int dll_count) - : m_name(name), m_initialized(false), m_pfn(nullptr) + : m_name(name), m_module(NULL), m_initialized(false), m_pfn(nullptr) { for (int i = 0; i < dll_count; i++) m_dll_names.push_back(std::wstring(dll_names[i])); @@ -187,14 +187,20 @@ int lazy_loaded_function::initialize() } if (m_module == NULL) + { + osd_printf_verbose("Could not find DLL to dynamically link function %s.\n", m_name.c_str()); return ERROR_DLL_NOT_FOUND; + } } if (m_pfn == nullptr) { m_pfn = GetProcAddress(m_module, m_name.c_str()); if (m_pfn == nullptr) + { + osd_printf_verbose("Could not find function address to dynamically link function %s.\n", m_name.c_str()); return ERROR_NOT_FOUND; + } } m_initialized = true; diff --git a/src/osd/windows/winutil.h b/src/osd/windows/winutil.h index 8f205e5a8ba..530327dcf61 100644 --- a/src/osd/windows/winutil.h +++ b/src/osd/windows/winutil.h @@ -153,4 +153,26 @@ public: } }; +// Five parameters +template <class TRet, class P1, class P2, class P3, class P4, class P5> +class lazy_loaded_function_p5 : public lazy_loaded_function +{ +public: + lazy_loaded_function_p5(const char * name, const wchar_t* dll_name) + : lazy_loaded_function(name, &dll_name, 1) + { + } + + lazy_loaded_function_p5(const char * name, const wchar_t** dll_names, int dll_count) + : lazy_loaded_function(name, dll_names, dll_count) + { + } + + TRet operator ()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) + { + check_init(); + return ((TRet(__stdcall *) (P1, P2, P3, P4, P5))m_pfn)(p1, p2, p3, p4, p5); + } +}; + #endif // __WINUTIL__ |