diff options
author | Rod Smith <rodsmith@rodsbooks.com> | 2021-01-13 14:33:54 -0500 |
---|---|---|
committer | Rod Smith <rodsmith@rodsbooks.com> | 2021-01-13 14:33:54 -0500 |
commit | 273fff5c84288f3c09b32521d1217619e9cc079e (patch) | |
tree | b2762f5491289625c7784762e5bd36a81c5fdaa5 | |
parent | b160f90589abf830a704dc8d1482306bf7fa77cf (diff) | |
download | sgdisk-273fff5c84288f3c09b32521d1217619e9cc079e.tar.gz |
Adjust position of multiple-inclusion protection in .h files
-rw-r--r-- | attributes.h | 6 | ||||
-rw-r--r-- | basicmbr.h | 6 | ||||
-rw-r--r-- | bsd.h | 6 | ||||
-rw-r--r-- | diskio-unix.cc | 4 | ||||
-rw-r--r-- | gpt.h | 6 | ||||
-rw-r--r-- | gptcurses.h | 6 | ||||
-rw-r--r-- | mbr.h | 6 | ||||
-rw-r--r-- | parttypes.h | 6 | ||||
-rw-r--r-- | support.h | 6 |
9 files changed, 28 insertions, 24 deletions
diff --git a/attributes.h b/attributes.h index f6c66ff..6a61b8c 100644 --- a/attributes.h +++ b/attributes.h @@ -1,12 +1,12 @@ /* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ -#include <stdint.h> -#include <string> - #ifndef __GPT_ATTRIBUTES #define __GPT_ATTRIBUTES +#include <stdint.h> +#include <string> + #define NUM_ATR 64 /* # of attributes -- 64, since it's a 64-bit field */ #define ATR_NAME_SIZE 25 /* maximum size of attribute names */ @@ -3,14 +3,14 @@ /* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __BASICMBRSTRUCTS +#define __BASICMBRSTRUCTS + #include <stdint.h> #include <sys/types.h> #include "diskio.h" #include "mbrpart.h" -#ifndef __BASICMBRSTRUCTS -#define __BASICMBRSTRUCTS - #define MBR_SIGNATURE UINT16_C(0xAA55) // Maximum number of MBR partitions @@ -3,14 +3,14 @@ /* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __BSD_STRUCTS +#define __BSD_STRUCTS + #include <stdint.h> #include <sys/types.h> #include "gptpart.h" #include "diskio.h" -#ifndef __BSD_STRUCTS -#define __BSD_STRUCTS - #define BSD_SIGNATURE UINT32_C(0x82564557) /* BSD disklabel signature ("magic") */ // BSD disklabels can start at offsets of 64 or the sector size -- at least, diff --git a/diskio-unix.cc b/diskio-unix.cc index 35a4f5e..4aefc6f 100644 --- a/diskio-unix.cc +++ b/diskio-unix.cc @@ -37,6 +37,10 @@ using namespace std; +#ifdef __APPLE__ +#define off64_t off_t +#endif + // Returns the official "real" name for a shortened version of same. // Trivial here; more important in Windows void DiskIO::MakeRealName(void) { @@ -4,6 +4,9 @@ /* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __GPTSTRUCTS +#define __GPTSTRUCTS + #include <stdint.h> #include <sys/types.h> #include "gptpart.h" @@ -12,9 +15,6 @@ #include "bsd.h" #include "gptpart.h" -#ifndef __GPTSTRUCTS -#define __GPTSTRUCTS - // Default values for sector alignment #define DEFAULT_ALIGNMENT 2048 #define MAX_ALIGNMENT 65536 diff --git a/gptcurses.h b/gptcurses.h index f153de2..a080987 100644 --- a/gptcurses.h +++ b/gptcurses.h @@ -19,14 +19,14 @@ * */ +#ifndef __GPT_CURSES +#define __GPT_CURSES + #include <iostream> #include <string> #include "gptpart.h" #include "gpt.h" -#ifndef __GPT_CURSES -#define __GPT_CURSES - using namespace std; struct MenuItem { @@ -3,6 +3,9 @@ /* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __MBRSTRUCTS +#define __MBRSTRUCTS + #include <stdint.h> #include <sys/types.h> #include "gptpart.h" @@ -10,9 +13,6 @@ #include "diskio.h" #include "basicmbr.h" -#ifndef __MBRSTRUCTS -#define __MBRSTRUCTS - using namespace std; /**************************************** diff --git a/parttypes.h b/parttypes.h index 2b80026..92f3d64 100644 --- a/parttypes.h +++ b/parttypes.h @@ -1,6 +1,9 @@ /* This program is copyright (c) 2009-2018 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __PARTITION_TYPES +#define __PARTITION_TYPES + #include <stdint.h> #include <stdlib.h> #ifdef USE_UTF16 @@ -12,9 +15,6 @@ #include "support.h" #include "guid.h" -#ifndef __PARTITION_TYPES -#define __PARTITION_TYPES - using namespace std; // A partition type @@ -1,13 +1,13 @@ /* This program is copyright (c) 2009-2018 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ +#ifndef __GPTSUPPORT +#define __GPTSUPPORT + #include <stdint.h> #include <stdlib.h> #include <string> -#ifndef __GPTSUPPORT -#define __GPTSUPPORT - #define GPTFDISK_VERSION "1.0.6" #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) |