summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRod Smith <rodsmith@rodsbooks.com>2021-01-13 14:33:54 -0500
committerRod Smith <rodsmith@rodsbooks.com>2021-01-13 14:33:54 -0500
commit273fff5c84288f3c09b32521d1217619e9cc079e (patch)
treeb2762f5491289625c7784762e5bd36a81c5fdaa5
parentb160f90589abf830a704dc8d1482306bf7fa77cf (diff)
downloadsgdisk-273fff5c84288f3c09b32521d1217619e9cc079e.tar.gz
Adjust position of multiple-inclusion protection in .h files
-rw-r--r--attributes.h6
-rw-r--r--basicmbr.h6
-rw-r--r--bsd.h6
-rw-r--r--diskio-unix.cc4
-rw-r--r--gpt.h6
-rw-r--r--gptcurses.h6
-rw-r--r--mbr.h6
-rw-r--r--parttypes.h6
-rw-r--r--support.h6
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 */
diff --git a/basicmbr.h b/basicmbr.h
index 504e039..f4b0e45 100644
--- a/basicmbr.h
+++ b/basicmbr.h
@@ -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
diff --git a/bsd.h b/bsd.h
index cbd3588..c4b74a4 100644
--- a/bsd.h
+++ b/bsd.h
@@ -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) {
diff --git a/gpt.h b/gpt.h
index a5be961..9ba013b 100644
--- a/gpt.h
+++ b/gpt.h
@@ -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 {
diff --git a/mbr.h b/mbr.h
index bbb84ef..21c1d7b 100644
--- a/mbr.h
+++ b/mbr.h
@@ -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
diff --git a/support.h b/support.h
index 25e660a..d87fe9a 100644
--- a/support.h
+++ b/support.h
@@ -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__)