-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ckb-c-stdlib as a submodule #12
add ckb-c-stdlib as a submodule #12
Conversation
548c564
to
56ac98b
Compare
6da4bfd
to
21e0121
Compare
6854e7f
to
48069fd
Compare
@@ -5,7 +5,7 @@ CC := $(TARGET)-gcc | |||
LD := $(TARGET)-gcc | |||
OBJCOPY := $(TARGET)-objcopy | |||
|
|||
CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I lualib -I include/ckb-c-stdlib -I include/ckb-c-stdlib/libc -I include/ckb-c-stdlib/molecule -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g | |||
CFLAGS := -D__ISO_C_VISIBLE=1999 -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I lualib -I lualib/c-stdlib -I include/ckb-c-stdlib -I include/ckb-c-stdlib/libc -I include/ckb-c-stdlib/molecule -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -Wno-error=maybe-uninitialized -g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this macro "__ISO_C_VISIBLE=1999" used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If __ISO_C_VISIBLE=1999
then LLONG_MAX
is defined here https://github.com/nervosnetwork/ckb-c-stdlib/blob/efe1fe6b3cdda12e248e25664f5c04cbf7876265/libc/limits.h#L94 . Lua check the definition of LLONG_MAX
https://github.com/nervosnetwork/ckb-lua/blob/b71d44288e8fb085074d3af056b359b8c6c22afa/lualib/luaconf.h#L502 to define a few things. This is somewhat dirty.
This pull request adds ckb-c-stdlib as a git submodule. We have added quite a few functions to the ckb-c-stdlib (the complete list can be viewed from nervosnetwork/ckb-c-stdlib@master...contrun:ckb-c-stdlib:ckb-lua ). Theoretically we can use master branch of nervosnetwork/ckb-c-stdlib and add these functions to the ckb-lua repo, but keeping them in ckb-c-stdlib makes more sense. I currently use the this branch as a git submodule.