defs.h | defs.h | |||
---|---|---|---|---|
skipping to change at line 84 | skipping to change at line 84 | |||
BUILD_BUG_ON(!__signed_cast_compatible(typeof(type), typeof(expr))); \ | BUILD_BUG_ON(!__signed_cast_compatible(typeof(type), typeof(expr))); \ | |||
(type)(expr); \ | (type)(expr); \ | |||
}) | }) | |||
# endif | # endif | |||
# if defined(__GNUC__) && !defined(static_cast) | # if defined(__GNUC__) && !defined(static_cast) | |||
# define static_cast(type, expr) \ | # define static_cast(type, expr) \ | |||
((struct { type x; }){(expr)}.x) | ((struct { type x; }){(expr)}.x) | |||
# endif | # endif | |||
# if defined(__GNUC__) && !defined(const_cast1) | # if defined(__GNUC__) && !defined(const_cast1) | |||
# define __const_cast_strip1(expr) \ | # define __const_cast_strip1(expr) \ | |||
typeof(*(struct { typeof(expr) x; }){0}.x) | typeof(*(struct { int z; typeof(expr) x; }){0}.x) | |||
# define __const_cast_strip2(expr) \ | # define __const_cast_strip2(expr) \ | |||
typeof(**(struct { typeof(expr) x; }){0}.x) | typeof(**(struct { int z; typeof(expr) x; }){0}.x) | |||
# define __const_cast_strip3(expr) \ | # define __const_cast_strip3(expr) \ | |||
typeof(***(struct { typeof(expr) x; }){0}.x) | typeof(***(struct { int z; typeof(expr) x; }){0}.x) | |||
# define const_cast1(new_type, expr) ({ \ | # define const_cast1(new_type, expr) ({ \ | |||
BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip1(expr), __const_cast_strip1(new_type))); \ | BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip1(expr), __const_cast_strip1(new_type))); \ | |||
(new_type)(expr); \ | (new_type)(expr); \ | |||
}) | }) | |||
# define const_cast2(new_type, expr) ({ \ | # define const_cast2(new_type, expr) ({ \ | |||
BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip2(expr), __const_cast_strip2(new_type))); \ | BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip2(expr), __const_cast_strip2(new_type))); \ | |||
(new_type)(expr); \ | (new_type)(expr); \ | |||
}) | }) | |||
# define const_cast3(new_type, expr) ({ \ | # define const_cast3(new_type, expr) ({ \ | |||
BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip3(expr), __const_cast_strip3(new_type))); \ | BUILD_BUG_ON(!__builtin_types_compatible_p(__const_c ast_strip3(expr), __const_cast_strip3(new_type))); \ | |||
skipping to change at line 111 | skipping to change at line 111 | |||
# endif | # endif | |||
# ifndef signed_cast | # ifndef signed_cast | |||
# define signed_cast(type, expr) ((type)(expr)) | # define signed_cast(type, expr) ((type)(expr)) | |||
# endif | # endif | |||
# ifndef static_cast | # ifndef static_cast | |||
# define static_cast(type, expr) ((type)(expr)) | # define static_cast(type, expr) ((type)(expr)) | |||
# endif | # endif | |||
# ifndef const_cast | # ifndef const_cast | |||
# define const_cast(type, expr) ((type)(expr)) | # define const_cast(type, expr) ((type)(expr)) | |||
# endif | # endif | |||
# ifndef const_cast1 | ||||
# define const_cast1(type, expr) ((type)(expr)) | ||||
# define const_cast2(type, expr) ((type)(expr)) | ||||
# define const_cast3(type, expr) ((type)(expr)) | ||||
# endif | ||||
# ifndef reinterpret_cast | # ifndef reinterpret_cast | |||
# define reinterpret_cast(type, expr) ((type)(expr)) | # define reinterpret_cast(type, expr) ((type)(expr)) | |||
# endif | # endif | |||
# if defined(__GNUC__) && !defined(offsetof) | # if defined(__GNUC__) && !defined(offsetof) | |||
# define offsetof(type, member) __builtin_offsetof(type, membe r) | # define offsetof(type, member) __builtin_offsetof(type, membe r) | |||
# endif | # endif | |||
# ifndef offsetof | # ifndef offsetof | |||
# define offsetof(type, member) \ | # define offsetof(type, member) \ | |||
reinterpret_cast(long, &(static_cast(type *, NULL)-> member)) | reinterpret_cast(long, &(static_cast(type *, NULL)-> member)) | |||
# endif | # endif | |||
skipping to change at line 149 | skipping to change at line 154 | |||
#ifndef S_IWUGO | #ifndef S_IWUGO | |||
# define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) | # define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) | |||
#endif | #endif | |||
#ifndef S_IXUGO | #ifndef S_IXUGO | |||
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) | # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) | |||
#endif | #endif | |||
#ifndef S_IRWXUGO | #ifndef S_IRWXUGO | |||
# define S_IRWXUGO (S_IRUGO | S_IWUGO | S_IXUGO) | # define S_IRWXUGO (S_IRUGO | S_IWUGO | S_IXUGO) | |||
#endif | #endif | |||
/* 2^32 and -2^31 have differing length */ | ||||
#define HXSIZEOF_Z32 sizeof("-4294967296") | ||||
/* 2^64 and -2^63 have same length */ | ||||
#define HXSIZEOF_Z64 sizeof("18446744073709551616") | ||||
#define __HX_STRINGIFY_EXPAND(s) #s | ||||
#define HX_STRINGIFY(s) __HX_STRINGIFY_EXPAND(s) | ||||
#endif /* _LIBHX_DEFS_H */ | #endif /* _LIBHX_DEFS_H */ | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 16 lines changed or added | |||
misc.h | misc.h | |||
---|---|---|---|---|
skipping to change at line 56 | skipping to change at line 56 | |||
enum { | enum { | |||
HX_FSYSTEM_ARGV = 1 << 0, | HX_FSYSTEM_ARGV = 1 << 0, | |||
HX_FSYSTEM_EXEC = 1 << 1, | HX_FSYSTEM_EXEC = 1 << 1, | |||
HX_FSYSTEM_ARGV1 = 1 << 2, | HX_FSYSTEM_ARGV1 = 1 << 2, | |||
}; | }; | |||
extern int HX_ffs(unsigned long); | extern int HX_ffs(unsigned long); | |||
extern void HX_hexdump(FILE *, const void *, unsigned int); | extern void HX_hexdump(FILE *, const void *, unsigned int); | |||
extern long HX_time_compare(const struct stat *, const struct stat *, char) ; | extern long HX_time_compare(const struct stat *, const struct stat *, char) ; | |||
extern void HX_zvecfree(char **); | extern void HX_zvecfree(char **); | |||
extern int HX_fsystem(unsigned int, const char *, const char *, ...); | ||||
extern int HX_vfsystem(unsigned int, const char *, const char *, va_list); | ||||
/* | /* | |||
* RAND.C | * RAND.C | |||
*/ | */ | |||
extern int HX_rand(void); | extern int HX_rand(void); | |||
extern unsigned int HX_irand(unsigned int, unsigned int); | extern unsigned int HX_irand(unsigned int, unsigned int); | |||
/* | /* | |||
* INLINE FUNCTIONS | * INLINE FUNCTIONS | |||
*/ | */ | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 0 lines changed or added | |||
string.h | string.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
extern void HXmc_free(hxmc_t *); | extern void HXmc_free(hxmc_t *); | |||
/* | /* | |||
* STRING.C | * STRING.C | |||
*/ | */ | |||
extern char *HX_basename(const char *); | extern char *HX_basename(const char *); | |||
extern char *HX_chomp(char *); | extern char *HX_chomp(char *); | |||
extern char *HX_dirname(const char *); | extern char *HX_dirname(const char *); | |||
extern hxmc_t *HX_getl(hxmc_t **, FILE *); | extern hxmc_t *HX_getl(hxmc_t **, FILE *); | |||
extern char **HX_split(const char *, const char *, int *, int); | extern char **HX_split(const char *, const char *, int *, int); | |||
extern char **HX_split4(char *, const char *, int *, int); | ||||
extern int HX_split5(char *, const char *, int, char **); | extern int HX_split5(char *, const char *, int, char **); | |||
extern char *HX_strbchr(const char *, const char *, char); | extern char *HX_strbchr(const char *, const char *, char); | |||
extern char *HX_strclone(char **, const char *); | extern char *HX_strclone(char **, const char *); | |||
extern char *HX_strlower(char *); | extern char *HX_strlower(char *); | |||
extern size_t HX_strltrim(char *); | extern size_t HX_strltrim(char *); | |||
extern char *HX_strmid(const char *, long, long); | extern char *HX_strmid(const char *, long, long); | |||
extern size_t HX_strrcspn(const char *, const char *); | extern size_t HX_strrcspn(const char *, const char *); | |||
extern char *HX_strrev(char *); | extern char *HX_strrev(char *); | |||
extern size_t HX_strrtrim(char *); | extern size_t HX_strrtrim(char *); | |||
extern char *HX_strsep(char **, const char *); | extern char *HX_strsep(char **, const char *); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||