Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9534d4f0
Commit
9534d4f0
authored
Oct 18, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added wine_memcpy_unaligned function to avoid gcc memcpy
optimizations.
parent
b26206dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
port.h
include/wine/port.h
+7
-1
port.c
library/port.c
+14
-1
resource.c
loader/ne/resource.c
+4
-4
No files found.
include/wine/port.h
View file @
9534d4f0
...
@@ -190,7 +190,7 @@ int mkstemp(char *tmpfn);
...
@@ -190,7 +190,7 @@ int mkstemp(char *tmpfn);
#endif
/* HAVE_MKSTEMP */
#endif
/* HAVE_MKSTEMP */
#ifndef HAVE_MEMMOVE
#ifndef HAVE_MEMMOVE
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
unsigned
in
t
len
);
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
size_
t
len
);
#endif
/* !defined(HAVE_MEMMOVE) */
#endif
/* !defined(HAVE_MEMMOVE) */
#ifndef HAVE_PREAD
#ifndef HAVE_PREAD
...
@@ -229,6 +229,12 @@ int strcasecmp(const char *str1, const char *str2);
...
@@ -229,6 +229,12 @@ int strcasecmp(const char *str1, const char *str2);
int
usleep
(
unsigned
int
useconds
);
int
usleep
(
unsigned
int
useconds
);
#endif
/* !defined(HAVE_USLEEP) */
#endif
/* !defined(HAVE_USLEEP) */
#ifdef __i386__
#define wine_memcpy_unaligned memcpy
#else
extern
void
*
wine_memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
);
#endif
/* __i386__ */
/* Interlocked functions */
/* Interlocked functions */
#if defined(__i386__) && defined(__GNUC__)
#if defined(__i386__) && defined(__GNUC__)
...
...
library/port.c
View file @
9534d4f0
...
@@ -94,7 +94,7 @@ int usleep (unsigned int useconds)
...
@@ -94,7 +94,7 @@ int usleep (unsigned int useconds)
* memmove
* memmove
*/
*/
#ifndef HAVE_MEMMOVE
#ifndef HAVE_MEMMOVE
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
unsigned
in
t
len
)
void
*
memmove
(
void
*
dest
,
const
void
*
src
,
size_
t
len
)
{
{
register
char
*
dst
=
dest
;
register
char
*
dst
=
dest
;
...
@@ -666,6 +666,19 @@ char *gcvt (double number, size_t ndigit, char *buff)
...
@@ -666,6 +666,19 @@ char *gcvt (double number, size_t ndigit, char *buff)
#endif
/* HAVE_ECVT */
#endif
/* HAVE_ECVT */
#ifndef wine_memcpy_unaligned
/***********************************************************************
* wine_memcpy_unaligned
*
* This is necessary to defeat optimizations of memcpy by gcc.
*/
void
*
wine_memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
)
{
return
memcpy
(
dst
,
src
,
size
);
}
#endif
/***********************************************************************
/***********************************************************************
* interlocked functions
* interlocked functions
*/
*/
...
...
loader/ne/resource.c
View file @
9534d4f0
...
@@ -277,7 +277,7 @@ BOOL NE_InitResourceHandler( HMODULE16 hModule )
...
@@ -277,7 +277,7 @@ BOOL NE_InitResourceHandler( HMODULE16 hModule )
while
(
pTypeInfo
->
type_id
)
while
(
pTypeInfo
->
type_id
)
{
{
memcpy
(
&
pTypeInfo
->
resloader
,
&
DefResourceHandlerProc
,
sizeof
(
FARPROC16
)
);
wine_memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
DefResourceHandlerProc
,
sizeof
(
FARPROC16
)
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
}
}
return
TRUE
;
return
TRUE
;
...
@@ -303,8 +303,8 @@ FARPROC16 WINAPI SetResourceHandler16( HMODULE16 hModule, LPCSTR typeId,
...
@@ -303,8 +303,8 @@ FARPROC16 WINAPI SetResourceHandler16( HMODULE16 hModule, LPCSTR typeId,
{
{
if
(
!
(
pTypeInfo
=
NE_FindTypeSection
(
pResTab
,
pTypeInfo
,
typeId
)))
if
(
!
(
pTypeInfo
=
NE_FindTypeSection
(
pResTab
,
pTypeInfo
,
typeId
)))
break
;
break
;
memcpy
(
&
prevHandler
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
wine_memcpy_unaligned
(
&
prevHandler
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
memcpy
(
&
pTypeInfo
->
resloader
,
&
resourceHandler
,
sizeof
(
FARPROC16
)
);
wine_memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
resourceHandler
,
sizeof
(
FARPROC16
)
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
}
}
return
prevHandler
;
return
prevHandler
;
...
@@ -507,7 +507,7 @@ HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc )
...
@@ -507,7 +507,7 @@ HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc )
else
else
{
{
FARPROC16
resloader
;
FARPROC16
resloader
;
memcpy
(
&
resloader
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
wine_memcpy_unaligned
(
&
resloader
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
if
(
resloader
&&
resloader
!=
DefResourceHandlerProc
)
if
(
resloader
&&
resloader
!=
DefResourceHandlerProc
)
pNameInfo
->
handle
=
NE_CallTo16_word_www
(
pNameInfo
->
handle
=
NE_CallTo16_word_www
(
resloader
,
pNameInfo
->
handle
,
pModule
->
self
,
hRsrc
);
resloader
,
pNameInfo
->
handle
,
pModule
->
self
,
hRsrc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment