This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 11 files changed +68
-14
lines changed Expand file tree Collapse file tree 11 files changed +68
-14
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ else version (CRuntime_Glibc)
51
51
alias errno = __errno_location;
52
52
}
53
53
}
54
+ else version (CRuntime_Musl )
55
+ {
56
+ extern (C )
57
+ {
58
+ ref int __errno_location ();
59
+ alias errno = __errno_location;
60
+ }
61
+ }
54
62
else version (FreeBSD )
55
63
{
56
64
extern (C )
Original file line number Diff line number Diff line change @@ -627,15 +627,17 @@ else version( CRuntime_Musl )
627
627
FP_FAST_FMAL = 0 ,
628
628
}
629
629
630
+ pure {
630
631
int __fpclassifyf (float x);
631
632
int __fpclassify (double x);
632
633
int __fpclassifyl (real x);
633
634
634
635
int __signbitf (float x);
635
636
int __signbit (double x);
636
637
int __signbitl (real x);
638
+ }
637
639
638
- extern (D )
640
+ extern (D ) pure
639
641
{
640
642
// int fpclassify(real-floating x);
641
643
// /
@@ -711,19 +713,19 @@ else version( CRuntime_Musl )
711
713
712
714
// int isnormal(real-floating x);
713
715
// /
714
- pure int isnormal(float x) { return fpclassify(x) == FP_NORMAL ; }
716
+ int isnormal (float x) { return fpclassify(x) == FP_NORMAL ; }
715
717
// /
716
- pure int isnormal(double x) { return fpclassify(x) == FP_NORMAL ; }
718
+ int isnormal (double x) { return fpclassify(x) == FP_NORMAL ; }
717
719
// /
718
- pure int isnormal(real x) { return fpclassify(x) == FP_NORMAL ; }
720
+ int isnormal (real x) { return fpclassify(x) == FP_NORMAL ; }
719
721
720
722
// int signbit(real-floating x);
721
723
// /
722
- pure int signbit(float x) { return __signbitf(x); }
724
+ int signbit (float x) { return __signbitf(x); }
723
725
// /
724
- pure int signbit(double x) { return __signbit(x); }
726
+ int signbit (double x) { return __signbit(x); }
725
727
// /
726
- pure int signbit(real x)
728
+ int signbit (real x)
727
729
{
728
730
return (real .sizeof == double .sizeof)
729
731
? __signbit(x)
Original file line number Diff line number Diff line change @@ -377,6 +377,7 @@ unittest
377
377
// For example, Bionic doesn't appear to do so, so this test is
378
378
// not run on Android.
379
379
version (CRuntime_Bionic ) {} else
380
+ version (CRuntime_Musl ) {} else
380
381
assert (! mtx.tryLock_nothrow());
381
382
382
383
free(cast (void * ) mtx);
Original file line number Diff line number Diff line change @@ -383,7 +383,20 @@ else version( CRuntime_Bionic )
383
383
}
384
384
else version ( CRuntime_Musl )
385
385
{
386
+ enum
387
+ {
388
+ PTHREAD_CREATE_JOINABLE = 0 ,
389
+ PTHREAD_CREATE_DETACHED = 1
390
+ }
391
+
392
+ enum PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t .init;
393
+ enum PTHREAD_ONCE_INIT = pthread_once_t .init;
386
394
395
+ enum
396
+ {
397
+ PTHREAD_PROCESS_PRIVATE = 0 ,
398
+ PTHREAD_PROCESS_SHARED = 1
399
+ }
387
400
}
388
401
else
389
402
{
Original file line number Diff line number Diff line change @@ -3035,7 +3035,15 @@ else version( CRuntime_Bionic )
3035
3035
}
3036
3036
else version ( CRuntime_Musl )
3037
3037
{
3038
-
3038
+ struct sigevent
3039
+ {
3040
+ sigval sigev_value;
3041
+ int sigev_signo;
3042
+ int sigev_notify;
3043
+ void function (sigval) sigev_notify_function;
3044
+ pthread_attr_t * sigev_notify_attributes;
3045
+ char [56 - 3 * long .sizeof] __pad;
3046
+ }
3039
3047
}
3040
3048
else
3041
3049
{
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ else version( CRuntime_Bionic )
125
125
// Added since Lollipop
126
126
int posix_memalign (void ** , size_t , size_t );
127
127
}
128
+ else version ( CRuntime_Musl )
129
+ {
130
+ int posix_memalign (void ** , size_t , size_t );
131
+ }
128
132
129
133
//
130
134
// C Extension (CX)
Original file line number Diff line number Diff line change @@ -1294,11 +1294,11 @@ else version (CRuntime_Musl)
1294
1294
timespec st_atim;
1295
1295
timespec st_mtim;
1296
1296
timespec st_ctim;
1297
- extern (D )
1297
+ extern (D ) @safe @property
1298
1298
{
1299
- @property ref time_t st_atime() return { return st_atim.tv_sec; }
1300
- @property ref time_t st_mtime() return { return st_mtim.tv_sec; }
1301
- @property ref time_t st_ctime() return { return st_ctim.tv_sec; }
1299
+ ref time_t st_atime () return { return st_atim.tv_sec; }
1300
+ ref time_t st_mtime () return { return st_mtim.tv_sec; }
1301
+ ref time_t st_ctime () return { return st_ctim.tv_sec; }
1302
1302
}
1303
1303
long [3 ] __unused;
1304
1304
}
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ else version( CRuntime_Musl )
90
90
suseconds_t tv_usec;
91
91
}
92
92
int gettimeofday (timeval* , void * );
93
+ int utimes (in char * , ref const (timeval)[2 ]);
93
94
}
94
95
else version ( Darwin )
95
96
{
Original file line number Diff line number Diff line change @@ -134,6 +134,22 @@ else version(CRuntime_Bionic)
134
134
135
135
int uname (utsname* );
136
136
}
137
+ else version (CRuntime_Musl )
138
+ {
139
+ private enum SYS_NMLN = 65 ;
140
+
141
+ struct utsname
142
+ {
143
+ char [SYS_NMLN ] sysname;
144
+ char [SYS_NMLN ] nodename;
145
+ char [SYS_NMLN ] release;
146
+ char [SYS_NMLN ] _version;
147
+ char [SYS_NMLN ] machine;
148
+ char [SYS_NMLN ] domainname;
149
+ }
150
+
151
+ int uname (utsname* );
152
+ }
137
153
else
138
154
{
139
155
static assert (false , " unsupported system" );
Original file line number Diff line number Diff line change @@ -402,7 +402,6 @@ else version( CRuntime_Musl )
402
402
enum TIMER_ABSTIME = 1 ;
403
403
404
404
enum CLOCK_REALTIME = 0 ;
405
- enum CLOCK_MONOTONIC = 1 ;
406
405
enum CLOCK_PROCESS_CPUTIME_ID = 2 ;
407
406
enum CLOCK_THREAD_CPUTIME_ID = 3 ;
408
407
enum CLOCK_MONOTONIC_RAW = 4 ;
You can’t perform that action at this time.
0 commit comments