Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
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
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
b0ba2de7
Unverified
Commit
b0ba2de7
authored
5 years ago
by
Aaron Hill
Browse files
Options
Downloads
Patches
Plain Diff
Add Linux test
parent
457d6543
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.rs
+5
-0
5 additions, 0 deletions
build.rs
tests/const_fn.rs
+5
-0
5 additions, 0 deletions
tests/const_fn.rs
with
10 additions
and
0 deletions
build.rs
+
5
−
0
View file @
b0ba2de7
...
@@ -7,6 +7,7 @@ fn main() {
...
@@ -7,6 +7,7 @@ fn main() {
rustc_minor_version
()
.expect
(
"Failed to get rustc version"
);
rustc_minor_version
()
.expect
(
"Failed to get rustc version"
);
let
rustc_dep_of_std
=
env
::
var
(
"CARGO_FEATURE_RUSTC_DEP_OF_STD"
)
.is_ok
();
let
rustc_dep_of_std
=
env
::
var
(
"CARGO_FEATURE_RUSTC_DEP_OF_STD"
)
.is_ok
();
let
align_cargo_feature
=
env
::
var
(
"CARGO_FEATURE_ALIGN"
)
.is_ok
();
let
align_cargo_feature
=
env
::
var
(
"CARGO_FEATURE_ALIGN"
)
.is_ok
();
let
const_extern_fn_cargo_feature
=
env
::
var
(
"CARGO_FEATURE_CONST_EXTERN_FN"
)
.is_ok
();
let
libc_ci
=
env
::
var
(
"LIBC_CI"
)
.is_ok
();
let
libc_ci
=
env
::
var
(
"LIBC_CI"
)
.is_ok
();
if
env
::
var
(
"CARGO_FEATURE_USE_STD"
)
.is_ok
()
{
if
env
::
var
(
"CARGO_FEATURE_USE_STD"
)
.is_ok
()
{
...
@@ -72,6 +73,10 @@ fn main() {
...
@@ -72,6 +73,10 @@ fn main() {
if
rustc_dep_of_std
{
if
rustc_dep_of_std
{
println!
(
"cargo:rustc-cfg=libc_thread_local"
);
println!
(
"cargo:rustc-cfg=libc_thread_local"
);
}
}
if
const_extern_fn_cargo_feature
{
println!
(
"cargo:rustc-cfg=libc_const_extern_fn"
);
}
}
}
fn
rustc_minor_version
()
->
Option
<
u32
>
{
fn
rustc_minor_version
()
->
Option
<
u32
>
{
...
...
This diff is collapsed.
Click to expand it.
tests/const_fn.rs
0 → 100644
+
5
−
0
View file @
b0ba2de7
#![cfg(libc_const_extern_fn)]
// If this does not hold, the file is empty
#[cfg(target_os
=
"linux"
)]
const
_FOO
:
libc
::
c_uint
=
unsafe
{
libc
::
CMSG_SPACE
(
1
)
};
//^ if CMSG_SPACE is not const, this will fail to compile
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