Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
442
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
2f899029
Commit
2f899029
authored
12 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Win32: correctly implement flockfile() et al
This should fix gibberish interlaced log messages.
parent
f6baf564
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compat/flockfile.c
+18
-10
18 additions, 10 deletions
compat/flockfile.c
configure.ac
+3
-0
3 additions, 0 deletions
configure.ac
with
21 additions
and
10 deletions
compat/flockfile.c
+
18
−
10
View file @
2f899029
/*****************************************************************************
* flockfile.c: POSIX unlocked I/O stream stubs
*****************************************************************************
* Copyright © 2011 Rémi Denis-Courmont
* Copyright © 2011
-2012
Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -24,41 +24,49 @@
#include
<stdio.h>
/* There is no way to implement this for real. We just pretend it works and
* hope for the best (especially when outputting to stderr). */
#ifdef WIN32
# ifndef HAVE__LOCK_FILE
# warning Broken SDK: VLC logs will be garbage.
# define _lock_file(s) ((void)(s))
# define _unlock_file(s) ((void)(s))
# endif
void
flockfile
(
FILE
*
stream
)
{
(
void
)
stream
;
_lock_file
(
stream
)
;
}
int
ftrylockfile
(
FILE
*
stream
)
{
(
void
)
stream
;
flockfile
(
stream
);
/* Move along people, there is nothing to see here. */
return
0
;
}
void
funlockfile
(
FILE
*
stream
)
{
(
void
)
stream
;
_unlock_file
(
stream
)
;
}
int
getc_unlocked
(
FILE
*
stream
)
{
return
getc
(
stream
);
return
_
getc
_nolock
(
stream
);
}
int
getchar_unlocked
(
void
)
{
return
getchar
();
return
_
getchar
_nolock
();
}
int
putc_unlocked
(
int
c
,
FILE
*
stream
)
{
return
putc
(
c
,
stream
);
return
_
putc
_nolock
(
c
,
stream
);
}
int
putchar_unlocked
(
int
c
)
{
return
putchar
(
c
);
return
_
putchar
_nolock
(
c
);
}
#else
# error flockfile not implemented on your platform!
#endif
This diff is collapsed.
Click to expand it.
configure.ac
+
3
−
0
View file @
2f899029
...
...
@@ -535,6 +535,9 @@ case "$SYS" in
"linux")
AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
;;
"mingw32")
AC_CHECK_FUNCS([_lock_file])
;;
esac
AH_BOTTOM([#include <vlc_fixups.h>])
...
...
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