Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
tyrquake
Commits
687dadad
Commit
687dadad
authored
Dec 20, 2016
by
Christian Fetzer
Browse files
libretro: Fix undefined symbol strlcpy
parent
074d6bde
Changes
4
Show whitespace changes
Inline
Side-by-side
Makefile.common
View file @
687dadad
...
...
@@ -92,7 +92,8 @@ SOURCES_C := \
ifneq
($(STATIC_LINKING),1)
SOURCES_C
+=
\
$(CORE_DIR)
/libretro-common/file/retro_dirent.c
\
$(CORE_DIR)
/libretro-common/file/retro_stat.c
$(CORE_DIR)
/libretro-common/file/retro_stat.c
\
$(CORE_DIR)
/libretro-common/compat/compat_strl.c
endif
SOURCES_C
+=
$(CORE_DIR)
/common/net_none.c
...
...
common/snd_codec.c
View file @
687dadad
...
...
@@ -23,6 +23,8 @@
*
*/
#include "compat/strl.h"
#include "quakedef.h"
#include "sound.h"
#include "common.h"
...
...
libretro-common/compat/compat_strl.c
0 → 100644
View file @
687dadad
/* Copyright (C) 2010-2015 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (compat_strl.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <ctype.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_assert.h>
/* Implementation of strlcpy()/strlcat() based on OpenBSD. */
#ifndef __MACH__
size_t
strlcpy
(
char
*
dest
,
const
char
*
source
,
size_t
size
)
{
size_t
src_size
=
0
;
size_t
n
=
size
;
if
(
n
)
while
(
--
n
&&
(
*
dest
++
=
*
source
++
))
src_size
++
;
if
(
!
n
)
{
if
(
size
)
*
dest
=
'\0'
;
while
(
*
source
++
)
src_size
++
;
}
return
src_size
;
}
size_t
strlcat
(
char
*
dest
,
const
char
*
source
,
size_t
size
)
{
size_t
len
=
strlen
(
dest
);
dest
+=
len
;
if
(
len
>
size
)
size
=
0
;
else
size
-=
len
;
return
len
+
strlcpy
(
dest
,
source
,
size
);
}
#endif
libretro-common/include/retro_assert.h
0 → 100644
View file @
687dadad
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_assert.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __RETRO_ASSERT_H
#define __RETRO_ASSERT_H
#include <assert.h>
#ifdef RARCH_INTERNAL
#define retro_assert(cond) do { \
if (!(cond)) { printf("Assertion failed at %s:%d.\n", __FILE__, __LINE__); abort(); } \
} while(0)
#else
#define retro_assert(cond) assert(cond)
#endif
#endif
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