diff options
Diffstat (limited to 'TAO/tao/Align.h')
-rw-r--r-- | TAO/tao/Align.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/TAO/tao/Align.h b/TAO/tao/Align.h deleted file mode 100644 index 08839254fbe..00000000000 --- a/TAO/tao/Align.h +++ /dev/null @@ -1,59 +0,0 @@ -// This may look like C, but it's really -*- C++ -*- -// @(#) $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// Align.h -// -// = DESCRIPTION -// Pointer alignment utilities -// -// A "ptr_arith_t" type is defined for doing numerical operations -// on pointers, such as aligning them. Pointer sizes vary from 2 -// to 8 bytes in today's environments; a portable data type is much -// needed. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// -// ============================================================================ - -#if !defined (TAO_ALIGN_H) -#define TAO_ALIGN_H - -// Type for doing arithmetic on pointers ... as elsewhere, we assume -// that "unsigned" versions of a type are the same size as the -// "signed" version of the same type. - -#if ACE_SIZEOF_VOID_P == ACE_SIZEOF_INT -typedef u_int ptr_arith_t; - -#elif ACE_SIZEOF_VOID_P == ACE_SIZEOF_LONG -typedef u_long ptr_arith_t; - -#elif ACE_SIZEOF_VOID_P == ACE_SIZEOF_LONG_LONG -typedef u_long long ptr_arith_t; - -#else -# error "Can't find a suitable type for doing pointer arithmetic." -#endif /* error */ - -// Efficiently align "value" up to "alignment", knowing that all such -// boundaries are binary powers and that we're using two's complement -// arithmetic. - -#define align_binary(ptr, alignment) \ - ((ptr + ((ptr_arith_t)((alignment)-1))) & (~((ptr_arith_t)((alignment)-1)))) - -// Efficiently round "ptr" up to an "alignment" boundary, knowing that -// all such boundaries are binary powers and that we're using two's -// complement arithmetic. -// -#define ptr_align_binary(ptr, alignment) \ - ((u_char *) align_binary (((ptr_arith_t) (ptr)), (alignment))) - -#endif /* TAO_ALIGN_H */ |