ADTast-experimental
Last change
on this file since ab2b352 was
0aa4beb,
checked in by Thierry Delisle <tdelisle@…>, 2 years ago
|
Visibility of some of the stdlib
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[58b6d1b] | 1 | // -*- Mode: C -*- |
---|
| 2 | // |
---|
[0fc52b6] | 3 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
| 4 | // |
---|
| 5 | // The contents of this file are covered under the licence agreement in the |
---|
| 6 | // file "LICENCE" distributed with Cforall. |
---|
[58b6d1b] | 7 | // |
---|
| 8 | // common.c -- |
---|
| 9 | // |
---|
[0fc52b6] | 10 | // Author : Peter A. Buhr |
---|
| 11 | // Created On : Thu Jul 12 08:02:29 2018 |
---|
| 12 | // Last Modified By : Peter A. Buhr |
---|
| 13 | // Last Modified On : Thu Jul 12 08:38:47 2018 |
---|
| 14 | // Update Count : 3 |
---|
[58b6d1b] | 15 | // |
---|
[0fc52b6] | 16 | |
---|
[58b6d1b] | 17 | #include "common.hfa" |
---|
[0fc52b6] | 18 | #include <stdlib.h> // div_t, *div |
---|
| 19 | |
---|
[0aa4beb] | 20 | #pragma GCC visibility push(default) |
---|
| 21 | |
---|
[0fc52b6] | 22 | //--------------------------------------- |
---|
| 23 | |
---|
| 24 | [ int, int ] div( int num, int denom ) { div_t qr = div( num, denom ); return [ qr.quot, qr.rem ]; } |
---|
| 25 | [ long int, long int ] div( long int num, long int denom ) { ldiv_t qr = ldiv( num, denom ); return [ qr.quot, qr.rem ]; } |
---|
| 26 | [ long long int, long long int ] div( long long int num, long long int denom ) { lldiv_t qr = lldiv( num, denom ); return [ qr.quot, qr.rem ]; } |
---|
[fd54fef] | 27 | forall( T | { T ?/?( T, T ); T ?%?( T, T ); } ) |
---|
[0fc52b6] | 28 | [ T, T ] div( T num, T denom ) { return [ num / denom, num % denom ]; } |
---|
| 29 | |
---|
| 30 | // Local Variables: // |
---|
| 31 | // mode: c // |
---|
| 32 | // tab-width: 4 // |
---|
| 33 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.