Patch by Scott:
Make sure the comments are C style in headers that are included by POSIX headers. Thanks! Should fix #2870. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28598 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
#include <endian.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <TypeConstants.h>
|
||||
// for convenience
|
||||
/* for convenience */
|
||||
|
||||
|
||||
// swap directions
|
||||
/* swap directions */
|
||||
typedef enum {
|
||||
B_SWAP_HOST_TO_LENDIAN,
|
||||
B_SWAP_HOST_TO_BENDIAN,
|
||||
@@ -23,7 +23,7 @@ typedef enum {
|
||||
} swap_action;
|
||||
|
||||
|
||||
// BSD/networking macros
|
||||
/* BSD/networking macros */
|
||||
#ifndef htonl
|
||||
# define htonl(x) B_HOST_TO_BENDIAN_INT32(x)
|
||||
# define ntohl(x) B_BENDIAN_TO_HOST_INT32(x)
|
||||
@@ -31,7 +31,7 @@ typedef enum {
|
||||
# define ntohs(x) B_BENDIAN_TO_HOST_INT16(x)
|
||||
#endif
|
||||
|
||||
// always swap macros
|
||||
/* always swap macros */
|
||||
#define B_SWAP_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_SWAP_FLOAT(arg) __swap_float(arg)
|
||||
#define B_SWAP_INT64(arg) __swap_int64(arg)
|
||||
@@ -39,74 +39,74 @@ typedef enum {
|
||||
#define B_SWAP_INT16(arg) __swap_int16(arg)
|
||||
|
||||
#if BYTE_ORDER == __LITTLE_ENDIAN
|
||||
// Host is little endian
|
||||
/* Host is little endian */
|
||||
|
||||
#define B_HOST_IS_LENDIAN 1
|
||||
#define B_HOST_IS_BENDIAN 0
|
||||
|
||||
// Host native to little endian
|
||||
/* Host native to little endian */
|
||||
#define B_HOST_TO_LENDIAN_DOUBLE(arg) (double)(arg)
|
||||
#define B_HOST_TO_LENDIAN_FLOAT(arg) (float)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT64(arg) (uint64)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT32(arg) (uint32)(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT16(arg) (uint16)(arg)
|
||||
|
||||
// Little endian to host native
|
||||
/* Little endian to host native */
|
||||
#define B_LENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
|
||||
#define B_LENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT16(arg) (uint16)(arg)
|
||||
|
||||
// Host native to big endian
|
||||
/* Host native to big endian */
|
||||
#define B_HOST_TO_BENDIAN_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_HOST_TO_BENDIAN_FLOAT(arg) __swap_float(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT64(arg) __swap_int64(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT32(arg) __swap_int32(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT16(arg) __swap_int16(arg)
|
||||
|
||||
// Big endian to host native
|
||||
/* Big endian to host native */
|
||||
#define B_BENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_BENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)
|
||||
|
||||
#else // BYTE_ORDER
|
||||
// Host is big endian
|
||||
#else /* BYTE_ORDER */
|
||||
/* Host is big endian */
|
||||
|
||||
#define B_HOST_IS_LENDIAN 0
|
||||
#define B_HOST_IS_BENDIAN 1
|
||||
|
||||
// Host native to little endian
|
||||
/* Host native to little endian */
|
||||
#define B_HOST_TO_LENDIAN_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_HOST_TO_LENDIAN_FLOAT(arg) __swap_float(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT64(arg) __swap_int64(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT32(arg) __swap_int32(arg)
|
||||
#define B_HOST_TO_LENDIAN_INT16(arg) __swap_int16(arg)
|
||||
|
||||
// Little endian to host native
|
||||
/* Little endian to host native */
|
||||
#define B_LENDIAN_TO_HOST_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_LENDIAN_TO_HOST_FLOAT(arg) __swap_float(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT64(arg) __swap_int64(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT32(arg) __swap_int32(arg)
|
||||
#define B_LENDIAN_TO_HOST_INT16(arg) __swap_int16(arg)
|
||||
|
||||
// Host native to big endian
|
||||
/* Host native to big endian */
|
||||
#define B_HOST_TO_BENDIAN_DOUBLE(arg) (double)(arg)
|
||||
#define B_HOST_TO_BENDIAN_FLOAT(arg) (float)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT64(arg) (uint64)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT32(arg) (uint32)(arg)
|
||||
#define B_HOST_TO_BENDIAN_INT16(arg) (uint16)(arg)
|
||||
|
||||
// Big endian to host native
|
||||
/* Big endian to host native */
|
||||
#define B_BENDIAN_TO_HOST_DOUBLE(arg) (double)(arg)
|
||||
#define B_BENDIAN_TO_HOST_FLOAT(arg) (float)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT64(arg) (uint64)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT32(arg) (uint32)(arg)
|
||||
#define B_BENDIAN_TO_HOST_INT16(arg) (uint16)(arg)
|
||||
|
||||
#endif // BYTE_ORDER
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -118,7 +118,7 @@ extern status_t swap_data(type_code type, void *data, size_t length,
|
||||
extern bool is_type_swapped(type_code type);
|
||||
|
||||
|
||||
// Private implementations
|
||||
/* Private implementations */
|
||||
extern double __swap_double(double arg);
|
||||
extern float __swap_float(float arg);
|
||||
extern uint64 __swap_int64(uint64 arg);
|
||||
@@ -129,4 +129,4 @@ extern uint16 __swap_int16(uint16 arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _BYTEORDER_H
|
||||
#endif /* _BYTEORDER_H */
|
||||
|
||||
@@ -22,7 +22,7 @@ typedef unsigned short ushort;
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
// Shorthand type formats
|
||||
/* Shorthand type formats */
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef volatile signed char vint8;
|
||||
@@ -57,20 +57,20 @@ typedef unsigned char uchar;
|
||||
typedef unsigned short unichar;
|
||||
|
||||
|
||||
// Descriptive formats
|
||||
/* Descriptive formats */
|
||||
typedef int32 status_t;
|
||||
typedef int64 bigtime_t;
|
||||
typedef uint32 type_code;
|
||||
typedef uint32 perform_code;
|
||||
|
||||
|
||||
// Empty string ("")
|
||||
/* Empty string ("") */
|
||||
#ifdef __cplusplus
|
||||
extern const char *B_EMPTY_STRING;
|
||||
#endif
|
||||
|
||||
|
||||
// min and max comparisons
|
||||
/* min and max comparisons */
|
||||
#ifndef __cplusplus
|
||||
# ifndef min
|
||||
# define min(a,b) ((a)>(b)?(b):(a))
|
||||
@@ -80,12 +80,12 @@ extern const char *B_EMPTY_STRING;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// min() and max() won't work in C++
|
||||
/* min() and max() won't work in C++ */
|
||||
#define min_c(a,b) ((a)>(b)?(b):(a))
|
||||
#define max_c(a,b) ((a)>(b)?(a):(b))
|
||||
|
||||
|
||||
// Grandfathering
|
||||
/* Grandfathering */
|
||||
#ifndef __cplusplus
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
@@ -99,7 +99,7 @@ extern const char *B_EMPTY_STRING;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Atomic functions; previous value is returned
|
||||
/* Atomic functions; previous value is returned */
|
||||
extern int32 atomic_set(vint32 *value, int32 newValue);
|
||||
extern int32 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst);
|
||||
extern int32 atomic_add(vint32 *value, int32 addValue);
|
||||
@@ -114,16 +114,16 @@ extern int64 atomic_and64(vint64 *value, int64 andValue);
|
||||
extern int64 atomic_or64(vint64 *value, int64 orValue);
|
||||
extern int64 atomic_get64(vint64 *value);
|
||||
|
||||
// Other stuff
|
||||
/* Other stuff */
|
||||
extern void* get_stack_frame(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Obsolete or discouraged API
|
||||
/* Obsolete or discouraged API */
|
||||
|
||||
// use 'true' and 'false'
|
||||
/* use 'true' and 'false' */
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#endif
|
||||
@@ -131,4 +131,4 @@ extern void* get_stack_frame(void);
|
||||
# define TRUE 1
|
||||
#endif
|
||||
|
||||
#endif // _SUPPORT_DEFS_H
|
||||
#endif /* _SUPPORT_DEFS_H */
|
||||
|
||||
Reference in New Issue
Block a user