summaryrefslogtreecommitdiff
path: root/bits.h
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2008-08-03 16:42:57 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2008-08-03 16:42:57 +0000
commitf5e46a580df6fbf49f804d9b32c61abdfe4cf898 (patch)
treefd30dcc21493a7ddb14b648303167381308f6cd7 /bits.h
parent3ca39fe6c88d372412a6f1812568c42f4abe3ff9 (diff)
downloadgpsd-f5e46a580df6fbf49f804d9b32c61abdfe4cf898.tar.gz
Unify the header protection macro style a bit.
Headers likely to be private to gpsd are prefixed with _GPSD_, reusable ones like crc24q.h don't get the _GPSD_ prefix. Protection macro goes right up near the top of the file, right after the SVN id, and it's closure is the last line of the file.
Diffstat (limited to 'bits.h')
-rw-r--r--bits.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/bits.h b/bits.h
index 07e2d0d3..7d4c4db1 100644
--- a/bits.h
+++ b/bits.h
@@ -1,4 +1,7 @@
/* $Id$ */
+#ifndef _GPSD_BITS_H_
+#define _GPSD_BITS_H_
+
/*
* bits.h - extract binary data from message buffer
*
@@ -16,10 +19,9 @@
* The use of fixed-length types in the casts enforces these.
* Both 32- and 64-bit systems with gcc are OK with this set.
*/
+
#include <stdint.h>
-#ifndef BITS_H
-#define BITS_H
union int_float {
int32_t i;
float f;
@@ -29,7 +31,6 @@ union long_double {
int64_t l;
double d;
};
-#endif /* BITS_H */
#ifndef GET_ORIGIN
#define GET_ORIGIN 0
@@ -85,3 +86,5 @@ union long_double {
/* bitfield extraction */
extern unsigned long long ubits(char buf[], unsigned int, unsigned int);
extern signed long long sbits(char buf[], unsigned int, unsigned int);
+
+#endif /* _GPSD_BITS_H_ */