Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
195574e2
Commit
195574e2
authored
22 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Added memcpy_unaligned to libwine_port.
parent
408d0fd6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/wine/port.h
+6
-2
6 additions, 2 deletions
include/wine/port.h
libs/port/Makefile.in
+1
-0
1 addition, 0 deletions
libs/port/Makefile.in
libs/port/memcpy_unaligned.c
+27
-0
27 additions, 0 deletions
libs/port/memcpy_unaligned.c
loader/ne/resource.c
+4
-4
4 additions, 4 deletions
loader/ne/resource.c
with
38 additions
and
6 deletions
include/wine/port.h
+
6
−
2
View file @
195574e2
...
...
@@ -240,9 +240,12 @@ int usleep (unsigned int useconds);
#endif
/* !defined(HAVE_USLEEP) */
#ifdef __i386__
#define wine_memcpy_unaligned memcpy
extern
inline
void
*
memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
)
{
return
memcpy
(
dst
,
src
,
size
);
}
#else
extern
void
*
wine_
memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
);
extern
void
*
memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
);
#endif
/* __i386__ */
extern
int
mkstemps
(
char
*
template
,
int
suffix_len
);
...
...
@@ -314,6 +317,7 @@ extern long interlocked_xchg_add( long *dest, long incr );
#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr)
#define interlocked_xchg_add __WINE_NOT_PORTABLE(interlocked_xchg_add)
#define lstat __WINE_NOT_PORTABLE(lstat)
#define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned)
#define memmove __WINE_NOT_PORTABLE(memmove)
#define pread __WINE_NOT_PORTABLE(pread)
#define pwrite __WINE_NOT_PORTABLE(pwrite)
...
...
This diff is collapsed.
Click to expand it.
libs/port/Makefile.in
+
1
−
0
View file @
195574e2
...
...
@@ -11,6 +11,7 @@ C_SRCS = \
getpagesize.c
\
interlocked.c
\
lstat.c
\
memcpy_unaligned.c
\
memmove.c
\
mkstemps.c
\
pread.c
\
...
...
This diff is collapsed.
Click to expand it.
libs/port/memcpy_unaligned.c
0 → 100644
+
27
−
0
View file @
195574e2
/*
* Unaligned memcpy wrapper to defeat gcc optimizations.
*
* Copyright 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
"config.h"
#include
"wine/port.h"
void
*
memcpy_unaligned
(
void
*
dst
,
const
void
*
src
,
size_t
size
)
{
return
memcpy
(
dst
,
src
,
size
);
}
This diff is collapsed.
Click to expand it.
loader/ne/resource.c
+
4
−
4
View file @
195574e2
...
...
@@ -277,7 +277,7 @@ BOOL NE_InitResourceHandler( HMODULE16 hModule )
while
(
pTypeInfo
->
type_id
)
{
wine_
memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
DefResourceHandlerProc
,
sizeof
(
FARPROC16
)
);
memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
DefResourceHandlerProc
,
sizeof
(
FARPROC16
)
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
}
return
TRUE
;
...
...
@@ -303,8 +303,8 @@ FARPROC16 WINAPI SetResourceHandler16( HMODULE16 hModule, LPCSTR typeId,
{
if
(
!
(
pTypeInfo
=
NE_FindTypeSection
(
pResTab
,
pTypeInfo
,
typeId
)))
break
;
wine_
memcpy_unaligned
(
&
prevHandler
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
wine_
memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
resourceHandler
,
sizeof
(
FARPROC16
)
);
memcpy_unaligned
(
&
prevHandler
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
memcpy_unaligned
(
&
pTypeInfo
->
resloader
,
&
resourceHandler
,
sizeof
(
FARPROC16
)
);
pTypeInfo
=
NEXT_TYPEINFO
(
pTypeInfo
);
}
return
prevHandler
;
...
...
@@ -507,7 +507,7 @@ HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc )
else
{
FARPROC16
resloader
;
wine_
memcpy_unaligned
(
&
resloader
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
memcpy_unaligned
(
&
resloader
,
&
pTypeInfo
->
resloader
,
sizeof
(
FARPROC16
)
);
if
(
resloader
&&
resloader
!=
DefResourceHandlerProc
)
pNameInfo
->
handle
=
NE_CallTo16_word_www
(
resloader
,
pNameInfo
->
handle
,
pModule
->
self
,
hRsrc
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment