Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
core
tarantool
Commits
b197ba40
Commit
b197ba40
authored
11 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Convert third_party/lua-yaml/lyaml.c to C++ (to use try-catch block)
parent
ae638499
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
cmake/BuildLibYAML.cmake
+5
-1
5 additions, 1 deletion
cmake/BuildLibYAML.cmake
third_party/lua-yaml/lyaml.cc
+4
-2
4 additions, 2 deletions
third_party/lua-yaml/lyaml.cc
with
9 additions
and
3 deletions
cmake/BuildLibYAML.cmake
+
5
−
1
View file @
b197ba40
#
# A macro to build the bundled liblua-yaml
macro
(
libyaml_build
)
set
(
yaml_src
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/lyaml.c
set
(
yaml_src
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/lyaml.c
c
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/api.c
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/dumper.c
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/emitter.c
...
...
@@ -14,6 +14,10 @@ macro(libyaml_build)
set_source_files_properties
(
${
yaml_src
}
PROPERTIES COMPILE_FLAGS
"-std=c99"
)
set_source_files_properties
(
${
PROJECT_SOURCE_DIR
}
/third_party/lua-yaml/lyaml.cc
PROPERTIES COMPILE_FLAGS
"-std=gnu++0x -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1"
)
add_library
(
yaml STATIC
${
yaml_src
}
)
...
...
This diff is collapsed.
Click to expand it.
third_party/lua-yaml/lyaml.c
→
third_party/lua-yaml/lyaml.c
c
+
4
−
2
View file @
b197ba40
...
...
@@ -31,6 +31,7 @@
#include
<stdbool.h>
#include
<inttypes.h>
extern
"C"
{
#include
<lauxlib.h>
#include
<lua.h>
#include
<lualib.h>
...
...
@@ -42,6 +43,7 @@
#include
"yaml.h"
#include
"b64.h"
}
/* extern "C" */
#include
"lua/utils.h"
/* configurable flags */
...
...
@@ -845,7 +847,7 @@ static int l_null(lua_State *L) {
return
1
;
}
LUALIB_API
int
luaopen_yaml
(
lua_State
*
L
)
{
extern
"C"
int
luaopen_yaml
(
lua_State
*
L
)
{
const
luaL_reg
yamllib
[]
=
{
{
"decode"
,
l_load
},
{
"encode"
,
l_dump
},
...
...
@@ -858,6 +860,6 @@ LUALIB_API int luaopen_yaml(lua_State *L) {
return
1
;
}
LUALIB_API
int
yamlL_encode
(
lua_State
*
L
)
{
extern
"C"
int
yamlL_encode
(
lua_State
*
L
)
{
return
l_dump
(
L
);
}
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