project_files/hwc/rtl/misc.h
changeset 14180 0aeea29ef890
parent 10131 4b4a043111f4
child 15376 5c0479d0ed5b
equal deleted inserted replaced
14179:ddc77c3b1823 14180:0aeea29ef890
    18 #define     macro_dispatcher_(func, nargs)          macro_dispatcher__(func, nargs)
    18 #define     macro_dispatcher_(func, nargs)          macro_dispatcher__(func, nargs)
    19 #define     macro_dispatcher__(func, nargs)         func ## nargs
    19 #define     macro_dispatcher__(func, nargs)         func ## nargs
    20 
    20 
    21 //#define     FPCRTL_DEBUG
    21 //#define     FPCRTL_DEBUG
    22 
    22 
    23 #define     FIX_STRING(s)                           (s.str[s.len == 255 ? 254 : s.len] = 0)
    23 #define     FIX_STRING(s)                           do { s.str[s.len == 255 ? 254 : s.len] = 0; } while (0)
       
    24 #define     FIX_STRINGA(s)                          do { s.str[s.len == MAX_ANSISTRING_LENGTH ? MAX_ANSISTRING_LENGTH - 1 : s.len] = 0; } while (0)
    24 //#define fpcrtl_check_string(s)     do{ if(strlen((s).str) != (s).len){ \
    25 //#define fpcrtl_check_string(s)     do{ if(strlen((s).str) != (s).len){ \
    25 //                                        printf("String %s internal inconsistency error. Length should be %d but actually is %d.\n", (s).str, strlen((s).str), (s).len); \
    26 //                                        printf("String %s internal inconsistency error. Length should be %d but actually is %d.\n", (s).str, strlen((s).str), (s).len); \
    26 //                                        assert(0);\
    27 //                                        assert(0);\
    27 //                                    }}while(0)
    28 //                                    }}while(0)
    28 
    29