gonzui


Format: Advanced Search

tkernel_2/kernel/tkernel/src/longlong.hbare sourcepermlink (0.02 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      longlong.h
   17:  *
   18:  *      64 bit length integer
   19:  */
   20: 
   21: #ifndef _LONGLONG_
   22: #define _LONGLONG_
   23: 
   24: #ifdef __cplusplus
   25: extern "C" {
   26: #endif
   27: 
   28: typedef long long       longlong;
   29: 
   30: #define ltoll(a)        ( (longlong)(a) )
   31: #define ultoll(a)       ( (longlong)(a) )
   32: #define uitoll(a)       ( (longlong)(a) )
   33: #define lltol(a)        ( (D)(a) )
   34: #define ll_add(a,b)     ( (a) + (b) )
   35: #define ll_sub(a,b)     ( (a) - (b) )
   36: #define ll_mul(a,b)     ( (a) * (b) )
   37: #define li_mul(a,b)     ( (a) * (b) )
   38: #define lui_mul(a,b)    ( (a) * (b) )
   39: #define ll_div(a,b)     ( (a) / (b) )
   40: #define li_div(a,b)     ( (a) / (b) )
   41: #define lui_div(a,b)    ( (a) / (b) )
   42: #define ll_mod(a,b)     ( (a) % (b) )
   43: #define li_mod(a,b)     ( (a) % (b) )
   44: #define lui_mod(a,b)    ( (a) % (b) )
   45: #define ll_cmp(a,b)     ( (a) - (b) )       /* +:a>b,0:a=b,-:a<b */
   46: #define ll_sign(a)      ( (a) )              /* +:a>0,0:a=0,-:a<0 */
   47: #define ll_neg(a)       ( -(a) )
   48: #define ll_inc(a)       ( (*(a))++ )
   49: #define ll_dec(a)       ( (*(a))-- )
   50: 
   51: #define hilo_ll(ll, h, l)       ( (ll) = ((longlong)(h) << 32) | (l) )
   52: #define ll_hilo(h, l, ll)       ( (h) = (long)((ll) >> 32), \
   53:                                   (l) = (unsigned long)(ll) )
   54: 
   55: #ifdef __cplusplus
   56: }
   57: #endif
   58: #endif /* _LONGLONG_ */