Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a85b0a6d
Commit
a85b0a6d
authored
Nov 25, 2000
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Nov 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checking for mmap.
parent
01af00a5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
1 deletion
+49
-1
configure
configure
+0
-0
configure.in
configure.in
+1
-0
config.h.in
include/config.h.in
+3
-0
bin2res.c
tools/bin2res.c
+41
-1
res16.c
tools/winebuild/res16.c
+2
-0
res32.c
tools/winebuild/res32.c
+2
-0
No files found.
configure
View file @
a85b0a6d
This diff is collapsed.
Click to expand it.
configure.in
View file @
a85b0a6d
...
...
@@ -719,6 +719,7 @@ AC_CHECK_FUNCS(\
getsockopt \
inet_network \
memmove \
mmap \
rfork \
select \
sendmsg \
...
...
include/config.h.in
View file @
a85b0a6d
...
...
@@ -203,6 +203,9 @@
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the mmap function. */
#undef HAVE_MMAP
/* Define if you have the openpty function. */
#undef HAVE_OPENPTY
...
...
tools/bin2res.c
View file @
a85b0a6d
...
...
@@ -38,7 +38,6 @@ char* g_lpstrFileName = NULL;
char
*
g_lpstrInputFile
=
NULL
;
int
b_to_binary
=
0
;
int
b_force_overwrite
=
0
;
LPBYTE
p_in_file
=
NULL
;
static
char
*
errorOpenFile
=
"Unable to open file.
\n
"
;
static
char
*
errorRCFormat
=
"Unexpexted syntax in rc file line %i
\n
"
;
...
...
@@ -102,9 +101,11 @@ void parse_options(int argc, char **argv)
int
insert_hex
(
char
*
infile
,
FILE
*
outfile
)
{
#ifdef HAVE_MMAP
unsigned
int
i
;
int
fd
;
struct
stat
st
;
LPBYTE
p_in_file
=
NULL
;
if
(
(
fd
=
open
(
infile
,
O_RDONLY
))
==-
1
)
{
...
...
@@ -130,6 +131,45 @@ int insert_hex (char * infile, FILE * outfile)
munmap
(
p_in_file
,
st
.
st_size
);
close
(
fd
);
return
1
;
#else
/* HAVE_MMAP */
FILE
*
fp
;
struct
stat
st
;
unsigned
int
i
;
int
c
;
fp
=
fopen
(
infile
,
"r"
);
if
(
fp
==
NULL
)
{
fprintf
(
stderr
,
errorOpenFile
);
exit
(
1
);
}
if
(
fstat
(
fileno
(
fp
),
&
st
)
==
-
1
)
{
fprintf
(
stderr
,
errorOpenFile
);
fclose
(
fp
);
exit
(
1
);
}
fprintf
(
outfile
,
"{
\n
'"
);
i
=
0
;
while
(
1
)
{
c
=
fgetc
(
fp
);
if
(
c
==
EOF
)
{
fprintf
(
stderr
,
errorOpenFile
);
fclose
(
fp
);
exit
(
1
);
}
fprintf
(
outfile
,
"%02X"
,
c
);
if
(
++
i
>=
st
.
st_size
)
break
;
fprintf
(
outfile
,
"%s"
,
(
i
==
(
i
&
0xfffffff0
))
?
"'
\n
'"
:
" "
);
}
fprintf
(
outfile
,
"'
\n
}"
);
fclose
(
fp
);
return
1
;
#endif
/* HAVE_MMAP */
}
int
convert_to_res
()
...
...
tools/winebuild/res16.c
View file @
a85b0a6d
...
...
@@ -145,7 +145,9 @@ void load_res16_file( const char *name )
if
((
fd
=
open
(
name
,
O_RDONLY
))
==
-
1
)
fatal_perror
(
"Cannot open %s"
,
name
);
if
((
fstat
(
fd
,
&
st
)
==
-
1
))
fatal_perror
(
"Cannot stat %s"
,
name
);
if
(
!
st
.
st_size
)
fatal_error
(
"%s is an empty file
\n
"
);
#ifdef HAVE_MMAP
if
((
base
=
mmap
(
NULL
,
st
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
))
==
(
void
*
)
-
1
)
#endif
/* HAVE_MMAP */
{
base
=
xmalloc
(
st
.
st_size
);
if
(
read
(
fd
,
base
,
st
.
st_size
)
!=
st
.
st_size
)
...
...
tools/winebuild/res32.c
View file @
a85b0a6d
...
...
@@ -187,7 +187,9 @@ void load_res32_file( const char *name )
if
((
fd
=
open
(
name
,
O_RDONLY
))
==
-
1
)
fatal_perror
(
"Cannot open %s"
,
name
);
if
((
fstat
(
fd
,
&
st
)
==
-
1
))
fatal_perror
(
"Cannot stat %s"
,
name
);
if
(
!
st
.
st_size
)
fatal_error
(
"%s is an empty file
\n
"
);
#ifdef HAVE_MMAP
if
((
base
=
mmap
(
NULL
,
st
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
))
==
(
void
*
)
-
1
)
#endif
/* HAVE_MMAP */
{
base
=
xmalloc
(
st
.
st_size
);
if
(
read
(
fd
,
base
,
st
.
st_size
)
!=
st
.
st_size
)
...
...
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