remove explicit unicode def/undefs

This commit is contained in:
Brad Parker 2016-12-02 12:46:32 -05:00
parent 44b95a1602
commit d891f1c90b
8 changed files with 71 additions and 70 deletions

View File

@ -408,7 +408,7 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
} }
*quit = true; *quit = true;
break; break;
case WM_COMMAND: case WM_COMMAND:
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (settings->ui.menubar_enable) if (settings->ui.menubar_enable)
@ -533,7 +533,7 @@ bool win32_window_create(void *data, unsigned style,
#endif #endif
bool win32_get_metrics(void *data, bool win32_get_metrics(void *data,
enum display_metric_types type, float *value) enum display_metric_types type, float *value)
{ {
#ifdef _XBOX #ifdef _XBOX
return false; return false;
@ -714,14 +714,14 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use,
} }
else else
{ {
char dev_name[CCHDEVICENAME] = {0}; char dev_name[CCHDEVICENAME] = {0};
*style = WS_POPUP | WS_VISIBLE; *style = WS_POPUP | WS_VISIBLE;
utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name));
if (!win32_monitor_set_fullscreen(*width, *height, if (!win32_monitor_set_fullscreen(*width, *height,
refresh, dev_name)) refresh, dev_name))
{} {}
/* Display settings might have changed, get new coordinates. */ /* Display settings might have changed, get new coordinates. */
GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon);

View File

@ -18,12 +18,10 @@
#define WIN32_COMMON_H__ #define WIN32_COMMON_H__
#include <string.h> #include <string.h>
#include <encodings/win32.h>
#ifndef _XBOX #ifndef _XBOX
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define UNICODE
#include <tchar.h>
#include <wchar.h>
#include <windows.h> #include <windows.h>
#endif #endif
@ -83,7 +81,7 @@ bool win32_window_create(void *data, unsigned style,
bool win32_suppress_screensaver(void *data, bool enable); bool win32_suppress_screensaver(void *data, bool enable);
bool win32_get_metrics(void *data, bool win32_get_metrics(void *data,
enum display_metric_types type, float *value); enum display_metric_types type, float *value);
void win32_show_cursor(bool state); void win32_show_cursor(bool state);

View File

@ -15,13 +15,11 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <encodings/win32.h>
#ifdef _XBOX #ifdef _XBOX
#include <xtl.h> #include <xtl.h>
#include <xgraphics.h> #include <xgraphics.h>
#else
#define UNICODE
#include <tchar.h>
#include <wchar.h>
#endif #endif
#include <formats/image.h> #include <formats/image.h>
@ -155,14 +153,14 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
video_info->input_scale * RARCH_SCALE_BASE; video_info->input_scale * RARCH_SCALE_BASE;
if (!renderchain_init_first(&d3d->renderchain_driver, if (!renderchain_init_first(&d3d->renderchain_driver,
&d3d->renderchain_data)) &d3d->renderchain_data))
{ {
RARCH_ERR("Renderchain could not be initialized.\n"); RARCH_ERR("Renderchain could not be initialized.\n");
return false; return false;
} }
if (!d3d->renderchain_driver || !d3d->renderchain_data) if (!d3d->renderchain_driver || !d3d->renderchain_data)
return false; return false;
if ( if (
!d3d->renderchain_driver->init( !d3d->renderchain_driver->init(
@ -187,7 +185,7 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
for (i = 1; i < d3d->shader.passes; i++) for (i = 1; i < d3d->shader.passes; i++)
{ {
d3d->renderchain_driver->convert_geometry(d3d->renderchain_data, d3d->renderchain_driver->convert_geometry(d3d->renderchain_data,
&link_info, &link_info,
&out_width, &out_height, &out_width, &out_height,
current_width, current_height, &d3d->final_viewport); current_width, current_height, &d3d->final_viewport);
@ -806,7 +804,7 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info)
video_driver_get_size(&width, &height); video_driver_get_size(&width, &height);
d3d_set_viewport(d3d, d3d_set_viewport(d3d,
width, height, false, true); width, height, false, true);
#if defined(_XBOX360) #if defined(_XBOX360)
strlcpy(settings->path.font, "game:\\media\\Arial_12.xpr", strlcpy(settings->path.font, "game:\\media\\Arial_12.xpr",
@ -1047,7 +1045,7 @@ static bool d3d_construct(d3d_video_t *d3d,
win_height, info->fullscreen); win_height, info->fullscreen);
win32_set_window(&win_width, &win_height, info->fullscreen, win32_set_window(&win_width, &win_height, info->fullscreen,
windowed_full, &rect); windowed_full, &rect);
#endif #endif
#ifdef HAVE_SHADERS #ifdef HAVE_SHADERS
@ -1337,7 +1335,7 @@ static bool d3d_overlay_load(void *data,
image_data; image_data;
if (!d3d) if (!d3d)
return false; return false;
d3d_free_overlays(d3d); d3d_free_overlays(d3d);
d3d->overlays.resize(num_images); d3d->overlays.resize(num_images);
@ -1603,7 +1601,7 @@ static void d3d_set_menu_texture_frame(void *data,
|| d3d->menu->tex_h != height) || d3d->menu->tex_h != height)
{ {
if (d3d->menu) if (d3d->menu)
d3d_texture_free(d3d->menu->tex); d3d_texture_free(d3d->menu->tex);
d3d->menu->tex = d3d_texture_new(d3d->dev, NULL, d3d->menu->tex = d3d_texture_new(d3d->dev, NULL,
width, height, 1, width, height, 1,
@ -1739,7 +1737,7 @@ static void d3d_unload_texture(void *data, uintptr_t id)
{ {
LPDIRECT3DTEXTURE texid; LPDIRECT3DTEXTURE texid;
if (!id) if (!id)
return; return;
texid = (LPDIRECT3DTEXTURE)id; texid = (LPDIRECT3DTEXTURE)id;
d3d_texture_free(texid); d3d_texture_free(texid);

View File

@ -29,10 +29,7 @@
#define WM_MOUSEWHEEL 0x020A #define WM_MOUSEWHEEL 0x020A
#endif #endif
#define UNICODE #include <encodings/win32.h>
#include <tchar.h>
#include <wchar.h>
#include <dinput.h> #include <dinput.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -53,7 +53,6 @@ extern "C" {
} }
#endif #endif
#undef UNICODE /* Do not bother with UNICODE at this time. */
#include <direct.h> #include <direct.h>
#include <stddef.h> #include <stddef.h>
#include <math.h> #include <math.h>

View File

@ -28,7 +28,17 @@
#define UNICODE #define UNICODE
#include <tchar.h> #include <tchar.h>
#include <wchar.h> #include <wchar.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <encodings/utf.h> #include <encodings/utf.h>
#ifdef __cplusplus
}
#endif
#endif #endif
#endif #endif

View File

@ -45,11 +45,12 @@
#include <time.h> #include <time.h>
#endif #endif
#ifdef _WIN32
#include <encodings/win32.h>
#endif
#if defined(_WIN32) && !defined(_XBOX) #if defined(_WIN32) && !defined(_XBOX)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define UNICODE
#include <tchar.h>
#include <wchar.h>
#include <windows.h> #include <windows.h>
#elif defined(_WIN32) && defined(_XBOX) #elif defined(_WIN32) && defined(_XBOX)
#include <Xtl.h> #include <Xtl.h>

View File

@ -26,9 +26,7 @@
#include <errno.h> #include <errno.h>
#if defined(_WIN32) #if defined(_WIN32)
# define UNICODE #include <encodings/win32.h>
# include <tchar.h>
# include <wchar.h>
# ifdef _MSC_VER # ifdef _MSC_VER
# define setmode _setmode # define setmode _setmode
# endif # endif