PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ wkb_swap_bytes()

static int wkb_swap_bytes ( uint8_t  variant)
inlinestatic

Definition at line 182 of file lwout_wkb.c.

References getMachineEndian(), LW_FALSE, LW_TRUE, NDR, WKB_NDR, and XDR.

Referenced by double_to_wkb_buf(), integer_to_wkb_buf(), and ptarray_to_wkb_buf().

183 {
184  /* If requested variant matches machine arch, we don't have to swap! */
185  if ( ((variant & WKB_NDR) && (getMachineEndian() == NDR)) ||
186  ((! (variant & WKB_NDR)) && (getMachineEndian() == XDR)) )
187  {
188  return LW_FALSE;
189  }
190  return LW_TRUE;
191 }
uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_NDR
Definition: liblwgeom.h:2077
#define NDR
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
char getMachineEndian(void)
Definition: lwutil.c:360
#define XDR
Here is the call graph for this function:
Here is the caller graph for this function: