Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
f22b0d94
Commit
f22b0d94
authored
Aug 27, 2009
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WinCE: add replacement getpid() function
And remove #ifdefs from code
parent
52d3152a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
14 deletions
+48
-14
compat/getpid.c
compat/getpid.c
+37
-0
configure.ac
configure.ac
+1
-1
include/vlc_fixups.h
include/vlc_fixups.h
+8
-0
src/config/file.c
src/config/file.c
+1
-7
src/modules/cache.c
src/modules/cache.c
+1
-6
No files found.
compat/getpid.c
0 → 100644
View file @
f22b0d94
/*****************************************************************************
* getpid.c: POSIX getpid() replacement
*****************************************************************************
* Copyright © 2009 the VideoLAN project
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef WIN32
# include <windows.h>
#endif
pid_t
getpid
(
void
)
{
#ifdef WIN32
return
(
pid_t
)
GetCurrentProcessId
();
#else
# error Unimplemented!
#endif
}
configure.ac
View file @
f22b0d94
...
...
@@ -564,7 +564,7 @@ dnl Check for usual libc functions
AC_CHECK_FUNCS([gettimeofday isatty sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv ctime_r daemon fork lstat posix_fadvise posix_madvise uselocale])
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(fcntl)
AC_REPLACE_FUNCS([asprintf atof atoll getcwd gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtoll vasprintf swab])
AC_REPLACE_FUNCS([asprintf atof atoll getcwd g
etpid g
mtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtoll vasprintf swab])
AC_CHECK_FUNCS([stricmp strnicmp])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
...
...
include/vlc_fixups.h
View file @
f22b0d94
...
...
@@ -53,6 +53,10 @@ typedef struct
# include <stdarg.h>
/* va_list */
#endif
#ifndef HAVE_GETPID
# include <sys/types.h>
/* pid_t */
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -133,6 +137,10 @@ void rewind (FILE *);
char
*
getcwd
(
char
*
buf
,
size_t
size
);
#endif
#ifndef HAVE_GETPID
pid_t
getpid
(
void
);
#endif
#ifdef __cplusplus
}
/* extern "C" */
#endif
...
...
src/config/file.c
View file @
f22b0d94
...
...
@@ -522,13 +522,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
goto
error
;
}
if
(
asprintf
(
&
temporary
,
"%s.%u"
,
permanent
,
#ifdef UNDER_CE
GetCurrentProcessId
()
#else
getpid
()
#endif
)
==
-
1
)
if
(
asprintf
(
&
temporary
,
"%s.%u"
,
permanent
,
getpid
())
==
-
1
)
{
temporary
=
NULL
;
module_list_free
(
list
);
...
...
src/modules/cache.c
View file @
f22b0d94
...
...
@@ -508,12 +508,7 @@ void CacheSave( vlc_object_t *p_this, module_bank_t *p_bank )
char
psz_tmpname
[
sizeof
(
psz_filename
)
+
12
];
snprintf
(
psz_tmpname
,
sizeof
(
psz_tmpname
),
"%s.%"
PRIu32
,
psz_filename
,
#ifdef UNDER_CE
(
uint32_t
)
GetCurrentProcessId
()
#else
(
uint32_t
)
getpid
()
#endif
);
(
uint32_t
)
getpid
());
file
=
utf8_fopen
(
psz_tmpname
,
"wb"
);
if
(
file
==
NULL
)
goto
error
;
...
...
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