Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
9ab6d950
Commit
9ab6d950
authored
5 years ago
by
Izzard, Robert Dr (Maths & Physics)
Browse files
Options
Downloads
Patches
Plain Diff
add a hack to handle the OSX case where ieee754.h is missing
parent
3e29a165
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
meson.build
+10
-0
10 additions, 0 deletions
meson.build
src/binary_c_code_options.h
+2
-0
2 additions, 0 deletions
src/binary_c_code_options.h
src/maths/binary_c_drandr.c
+6
-0
6 additions, 0 deletions
src/maths/binary_c_drandr.c
with
18 additions
and
0 deletions
meson.build
+
10
−
0
View file @
9ab6d950
...
...
@@ -559,6 +559,16 @@ if compiler.has_header('malloc.h',
cflags
+=
'-D__HAVE_MALLOC_H__'
endif
############
# malloc.h #
#
if
compiler
.
has_header
(
'ieee754.h'
,
args
:
cflags
,
include_directories
:
include_directories
(
incdirs
))
cflags
+=
'-D__HAVE_IEEE754_H__'
endif
############
# setitimer
#
...
...
This diff is collapsed.
Click to expand it.
src/binary_c_code_options.h
+
2
−
0
View file @
9ab6d950
...
...
@@ -919,8 +919,10 @@ void Print_trace(void);
* use snprintf in place of strlcpy
*/
#ifndef __HAVE_LIBBSD__
#undef strlcpy
#define strlcpy(d,s,n) snprintf((d),(n),"%s",(s))
#define __STRLCPY_IS_MACRO__
#undef strlcat
#define strlcat(dest,source,size) __local_bsd_strlcat((dest),(source),(size))
#define __STRLCAT_IS_BSD_COPY__
#endif // __HAVE_LIBBSD__
...
...
This diff is collapsed.
Click to expand it.
src/maths/binary_c_drandr.c
+
6
−
0
View file @
9ab6d950
...
...
@@ -35,7 +35,9 @@
#include
<stdlib.h>
#include
"binary_c_drandr_types.h"
#include
"binary_c_drandr_prototypes.h"
#ifdef __HAVE_IEEE754_H__
#include
<ieee754.h>
#endif // ___HAVE_IEEE754_H__
#include
<limits.h>
#include
<stdint.h>
#include
<sys/types.h>
...
...
@@ -64,7 +66,11 @@ int binary_c_erand48_r (unsigned short int xsubi[3],
its fractional part so the resulting FP number is [0.0,1.0). */
temp
.
ieee
.
negative
=
0
;
#ifdef __HAVE_IEEE754_H__
temp
.
ieee
.
exponent
=
IEEE754_DOUBLE_BIAS
;
#else
temp
.
ieee
.
exponent
=
0x3ff
;
/* hard coded! */
#endif
temp
.
ieee
.
mantissa0
=
(
xsubi
[
2
]
<<
4
)
|
(
xsubi
[
1
]
>>
12
);
temp
.
ieee
.
mantissa1
=
((
xsubi
[
1
]
&
0xfff
)
<<
20
)
|
(
xsubi
[
0
]
<<
4
);
...
...
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