Skip to content

Instantly share code, notes, and snippets.

View cgaebel's full-sized avatar

Clark Gaebel cgaebel

  • Jane Street
  • New York, NY
View GitHub Profile
@cgaebel
cgaebel / gist:880419
Created March 21, 2011 23:01
region.c
/*
Copyright (c) 2011, Ryan Hitchman
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
/*
** 2011 January 5
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**/
/* are we running on a little-endian system? */
static inline int little_endian()
{
union {
uint16_t i;
char c[2];
} t = { 0x0001 };
return *t.c == 1;
}