]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | From ed3b6e4bca1fe5211e3d7ca06bbbf9b161c8bc19 Mon Sep 17 00:00:00 2001 |
2 | From: Michal Janiszewski <janisozaur@gmail.com> | |
3 | Date: Sat, 2 Nov 2019 14:50:53 -0700 | |
4 | Subject: [PATCH] Add naive MSVC support to sources | |
5 | ||
6 | --- | |
7 | libmpeg2/convert/rgb.c | 2 +- | |
8 | libmpeg2/cpu_accel.c | 4 ++-- | |
9 | libmpeg2/cpu_state.c | 4 ++-- | |
10 | libmpeg2/idct.c | 2 +- | |
11 | libmpeg2/motion_comp.c | 2 +- | |
12 | libvo/video_out_dx.c | 6 +++--- | |
13 | vc++/config.h | 2 ++ | |
14 | 7 files changed, 12 insertions(+), 10 deletions(-) | |
15 | ||
16 | diff --git a/libmpeg2/convert/rgb.c b/libmpeg2/convert/rgb.c | |
17 | index 8863b0b..db6f4e3 100644 | |
18 | --- a/libmpeg2/convert/rgb.c | |
19 | +++ b/libmpeg2/convert/rgb.c | |
20 | @@ -499,7 +499,7 @@ static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp, | |
21 | int convert420 = 0; | |
22 | int rgb_stride_min = ((bpp + 7) >> 3) * seq->width; | |
23 | ||
24 | -#ifdef ARCH_X86 | |
25 | +#if !defined(_MSC_VER) && defined(ARCH_X86) | |
26 | if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) { | |
27 | convert420 = 0; | |
28 | copy = mpeg2convert_rgb_mmxext (order, bpp, seq); | |
29 | diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c | |
30 | index 9b24610..a922df1 100644 | |
31 | --- a/libmpeg2/cpu_accel.c | |
32 | +++ b/libmpeg2/cpu_accel.c | |
33 | @@ -29,7 +29,7 @@ | |
34 | #include "attributes.h" | |
35 | #include "mpeg2_internal.h" | |
36 | ||
37 | -#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
38 | +#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) | |
39 | static inline uint32_t arch_accel (uint32_t accel) | |
40 | { | |
41 | if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) | |
42 | @@ -253,7 +253,7 @@ static inline uint32_t arch_accel (uint32_t accel) | |
43 | ||
44 | uint32_t mpeg2_detect_accel (uint32_t accel) | |
45 | { | |
46 | -#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) | |
47 | +#if !defined(_MSC_VER) && (defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)) | |
48 | accel = arch_accel (accel); | |
49 | #endif | |
50 | return accel; | |
51 | diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c | |
52 | index 2f2f64a..f4966c1 100644 | |
53 | --- a/libmpeg2/cpu_state.c | |
54 | +++ b/libmpeg2/cpu_state.c | |
55 | @@ -36,7 +36,7 @@ | |
56 | void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; | |
57 | void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; | |
58 | ||
59 | -#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
60 | +#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) | |
61 | static void state_restore_mmx (cpu_state_t * state) | |
62 | { | |
63 | emms (); | |
64 | @@ -115,7 +115,7 @@ static void state_restore_altivec (cpu_state_t * state) | |
65 | ||
66 | void mpeg2_cpu_state_init (uint32_t accel) | |
67 | { | |
68 | -#if defined(ARCH_X86) || defined(ARCH_X86_64) | |
69 | +#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64)) | |
70 | if (accel & MPEG2_ACCEL_X86_MMX) { | |
71 | mpeg2_cpu_state_restore = state_restore_mmx; | |
72 | } | |
73 | diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c | |
74 | index 81c57e0..a057bf7 100644 | |
75 | --- a/libmpeg2/idct.c | |
76 | +++ b/libmpeg2/idct.c | |
77 | @@ -235,7 +235,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block, | |
78 | ||
79 | void mpeg2_idct_init (uint32_t accel) | |
80 | { | |
81 | -#ifdef ARCH_X86 | |
82 | +#if !defined(_MSC_VER) && defined(ARCH_X86) | |
83 | if (accel & MPEG2_ACCEL_X86_SSE2) { | |
84 | mpeg2_idct_copy = mpeg2_idct_copy_sse2; | |
85 | mpeg2_idct_add = mpeg2_idct_add_sse2; | |
86 | diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c | |
87 | index 7aed113..b00a32d 100644 | |
88 | --- a/libmpeg2/motion_comp.c | |
89 | +++ b/libmpeg2/motion_comp.c | |
90 | @@ -33,7 +33,7 @@ mpeg2_mc_t mpeg2_mc; | |
91 | ||
92 | void mpeg2_mc_init (uint32_t accel) | |
93 | { | |
94 | -#ifdef ARCH_X86 | |
95 | +#if !defined(_MSC_VER) && defined(ARCH_X86) | |
96 | if (accel & MPEG2_ACCEL_X86_MMXEXT) | |
97 | mpeg2_mc = mpeg2_mc_mmxext; | |
98 | else if (accel & MPEG2_ACCEL_X86_3DNOW) | |
99 | diff --git a/libvo/video_out_dx.c b/libvo/video_out_dx.c | |
100 | index 36de68a..0797cdc 100644 | |
101 | --- a/libvo/video_out_dx.c | |
102 | +++ b/libvo/video_out_dx.c | |
103 | @@ -82,7 +82,7 @@ static void update_overlay (dx_instance_t * instance) | |
104 | dwFlags, &ddofx); | |
105 | } | |
106 | ||
107 | -static long FAR PASCAL event_procedure (HWND hwnd, UINT message, | |
108 | +static LRESULT FAR PASCAL event_procedure (HWND hwnd, UINT message, | |
109 | WPARAM wParam, LPARAM lParam) | |
110 | { | |
111 | RECT rect_window; | |
112 | @@ -92,7 +92,7 @@ static long FAR PASCAL event_procedure (HWND hwnd, UINT message, | |
113 | switch (message) { | |
114 | ||
115 | case WM_WINDOWPOSCHANGED: | |
116 | - instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA); | |
117 | + instance = (dx_instance_t *) GetWindowLongPtr (hwnd, GWLP_USERDATA); | |
118 | ||
119 | /* update the window position and size */ | |
120 | point_window.x = 0; | |
121 | @@ -173,7 +173,7 @@ static int create_window (dx_instance_t * instance) | |
122 | /* store a directx_instance pointer into the window local storage | |
123 | * (for later use in event_handler). | |
124 | * We need to use SetWindowLongPtr when it is available in mingw */ | |
125 | - SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance); | |
126 | + SetWindowLongPtr (instance->window, GWLP_USERDATA, (LONG_PTR) instance); | |
127 | ||
128 | ShowWindow (instance->window, SW_SHOW); | |
129 | ||
130 | diff --git a/vc++/config.h b/vc++/config.h | |
131 | index 93719f0..a03cce6 100644 | |
132 | --- a/vc++/config.h | |
133 | +++ b/vc++/config.h | |
134 | @@ -16,7 +16,9 @@ | |
135 | /* #undef ARCH_SPARC */ | |
136 | ||
137 | /* x86 architecture */ | |
138 | +#if defined(_M_AMD64) || defined(_M_IX86) | |
139 | #define ARCH_X86 | |
140 | +#endif | |
141 | ||
142 | /* maximum supported data alignment */ | |
143 | /* #undef ATTRIBUTE_ALIGNED_MAX */ | |
144 | -- | |
145 | 2.25.0 | |
146 |