aboutsummaryrefslogtreecommitdiff
path: root/src/third_party/mac_headers/mach-o
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/mac_headers/mach-o')
-rw-r--r--src/third_party/mac_headers/mach-o/arch.h51
-rw-r--r--src/third_party/mac_headers/mach-o/fat.h25
-rw-r--r--src/third_party/mac_headers/mach-o/loader.h236
-rw-r--r--src/third_party/mac_headers/mach-o/nlist.h20
4 files changed, 306 insertions, 26 deletions
diff --git a/src/third_party/mac_headers/mach-o/arch.h b/src/third_party/mac_headers/mach-o/arch.h
index 526c10fc..29b81c5b 100644
--- a/src/third_party/mac_headers/mach-o/arch.h
+++ b/src/third_party/mac_headers/mach-o/arch.h
@@ -48,7 +48,7 @@ typedef struct {
const char *description;
} NXArchInfo;
-#if __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -72,6 +72,36 @@ extern const NXArchInfo *NXGetArchInfoFromName(const char *name);
extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype,
cpu_subtype_t cpusubtype);
+/* The above interfaces that return pointers to NXArchInfo structs in normal
+ * cases returns a pointer from the array returned in NXGetAllArchInfos().
+ * In some cases when the cputype is CPU_TYPE_I386 or CPU_TYPE_POWERPC it will
+ * retun malloc(3)'ed NXArchInfo struct which contains a string in the
+ * description field also a malloc(3)'ed pointer. To allow programs not to
+ * leak memory they can call NXFreeArchInfo() on pointers returned from the
+ * above interfaces. Since this is a new API on older systems can use the
+ * code below. Going forward the above interfaces will only return pointers
+ * from the array returned in NXGetAllArchInfos().
+ */
+extern void NXFreeArchInfo(const NXArchInfo *x);
+
+/* The code that can be used for NXFreeArchInfo() when it is not available is:
+ *
+ * static void NXFreeArchInfo(
+ * const NXArchInfo *x)
+ * {
+ * const NXArchInfo *p;
+ *
+ * p = NXGetAllArchInfos();
+ * while(p->name != NULL){
+ * if(x == p)
+ * return;
+ * p++;
+ * }
+ * free((char *)x->description);
+ * free((NXArchInfo *)x);
+ * }
+ */
+
/* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of
* fat_arch structs and selects the best one that matches (if any) and returns
* a pointer to that fat_arch struct (or NULL). The fat_arch structs must be
@@ -86,6 +116,21 @@ extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype,
struct fat_arch *fat_archs,
uint32_t nfat_archs);
+/* NXFindBestFatArch_64() is passed a cputype and cpusubtype and a set of
+ * fat_arch_64 structs and selects the best one that matches (if any) and
+ * returns a pointer to that fat_arch_64 struct (or NULL). The fat_arch_64
+ * structs must be in the host byte order and correct such that the fat_archs64
+ * really points to enough memory for nfat_arch structs. It is possible that
+ * this routine could fail if new cputypes or cpusubtypes are added and an old
+ * version of this routine is used. But if there is an exact match between the
+ * cputype and cpusubtype and one of the fat_arch_64 structs this routine will
+ * always succeed.
+ */
+extern struct fat_arch_64 *NXFindBestFatArch_64(cpu_type_t cputype,
+ cpu_subtype_t cpusubtype,
+ struct fat_arch_64 *fat_archs64,
+ uint32_t nfat_archs);
+
/* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two
* different cpusubtypes for the specified cputype. If the two cpusubtypes
* can't be combined (the specific subtypes are mutually exclusive) -1 is
@@ -98,8 +143,8 @@ extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype,
cpu_subtype_t cpusubtype1,
cpu_subtype_t cpusubtype2);
-#if __cplusplus
+#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /* _MACH_O_ARCH_H_ */
+#endif /* _MACH_O_ARCH_H_ */ \ No newline at end of file
diff --git a/src/third_party/mac_headers/mach-o/fat.h b/src/third_party/mac_headers/mach-o/fat.h
index e2bcf433..0e5927dc 100644
--- a/src/third_party/mac_headers/mach-o/fat.h
+++ b/src/third_party/mac_headers/mach-o/fat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2016 Apple, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
@@ -49,7 +49,7 @@
#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */
struct fat_header {
- uint32_t magic; /* FAT_MAGIC */
+ uint32_t magic; /* FAT_MAGIC or FAT_MAGIC_64 */
uint32_t nfat_arch; /* number of structs that follow */
};
@@ -61,4 +61,23 @@ struct fat_arch {
uint32_t align; /* alignment as a power of 2 */
};
-#endif /* _MACH_O_FAT_H_ */
+/*
+ * The support for the 64-bit fat file format described here is a work in
+ * progress and not yet fully supported in all the Apple Developer Tools.
+ *
+ * When a slice is greater than 4mb or an offset to a slice is greater than 4mb
+ * then the 64-bit fat file format is used.
+ */
+#define FAT_MAGIC_64 0xcafebabf
+#define FAT_CIGAM_64 0xbfbafeca /* NXSwapLong(FAT_MAGIC_64) */
+
+struct fat_arch_64 {
+ cpu_type_t cputype; /* cpu specifier (int) */
+ cpu_subtype_t cpusubtype; /* machine specifier (int) */
+ uint64_t offset; /* file offset to this object file */
+ uint64_t size; /* size of this object file */
+ uint32_t align; /* alignment as a power of 2 */
+ uint32_t reserved; /* reserved */
+};
+
+#endif /* _MACH_O_FAT_H_ */ \ No newline at end of file
diff --git a/src/third_party/mac_headers/mach-o/loader.h b/src/third_party/mac_headers/mach-o/loader.h
index ff18e29c..2b03dfdc 100644
--- a/src/third_party/mac_headers/mach-o/loader.h
+++ b/src/third_party/mac_headers/mach-o/loader.h
@@ -115,11 +115,14 @@ struct mach_header_64 {
#define MH_DYLIB 0x6 /* dynamically bound shared library */
#define MH_DYLINKER 0x7 /* dynamic link editor */
#define MH_BUNDLE 0x8 /* dynamically bound bundle file */
-#define MH_DYLIB_STUB 0x9 /* shared library stub for static */
- /* linking only, no section contents */
-#define MH_DSYM 0xa /* companion file with only debug */
- /* sections */
+#define MH_DYLIB_STUB 0x9 /* shared library stub for static
+ linking only, no section contents */
+#define MH_DSYM 0xa /* companion file with only debug
+ sections */
#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */
+#define MH_FILESET 0xc /* a file composed of other Mach-Os to
+ be run in the same userspace sharing
+ a single linkedit. */
/* Constants for the flags field of the mach_header */
#define MH_NOUNDEFS 0x1 /* the object file has no undefined
@@ -207,6 +210,25 @@ struct mach_header_64 {
require it. Only used in MH_EXECUTE
filetypes. */
+#define MH_APP_EXTENSION_SAFE 0x02000000 /* The code was linked for use in an
+ application extension. */
+
+#define MH_NLIST_OUTOFSYNC_WITH_DYLDINFO 0x04000000 /* The external symbols
+ listed in the nlist symbol table do
+ not include all the symbols listed in
+ the dyld info. */
+
+#define MH_SIM_SUPPORT 0x08000000 /* Allow LC_MIN_VERSION_MACOS and
+ LC_BUILD_VERSION load commands with
+ the platforms macOS, macCatalyst,
+ iOSSimulator, tvOSSimulator and
+ watchOSSimulator. */
+
+#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit
+ is set, the dylib is part of the dyld
+ shared cache, rather than loose in
+ the filesystem. */
+
/*
* The load commands directly follow the mach_header. The total size of all
* of the commands is given by the sizeofcmds field in the mach_header. All
@@ -290,6 +312,20 @@ struct load_command {
#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */
#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat
like environment variable */
+#define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */
+#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */
+#define LC_SOURCE_VERSION 0x2A /* source version used to build binary */
+#define LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */
+#define LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */
+#define LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */
+#define LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */
+#define LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */
+#define LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */
+#define LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */
+#define LC_BUILD_VERSION 0x32 /* build for platform min OS version */
+#define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */
+#define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */
+#define LC_FILESET_ENTRY (0x35 | LC_REQ_DYLD) /* used with fileset_entry_command */
/*
* A variable length string in a load command is represented by an lc_str
@@ -367,6 +403,9 @@ struct segment_command_64 { /* for 64-bit architectures */
first page of the segment is not
protected. All other pages of the
segment are protected. */
+#define SG_READ_ONLY 0x10 /* This segment is made read-only after fixups */
+
+
/*
* A segment is made up of zero or more sections. Non-MH_OBJECT files have
@@ -492,6 +531,8 @@ struct section_64 { /* for 64-bit architectures */
#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call
to initialize TLV
values */
+#define S_INIT_FUNC_OFFSETS 0x16 /* 32-bit offsets to
+ initializers */
/*
* Constants for the section attributes part of the flags field of a section
@@ -753,14 +794,14 @@ struct dylinker_command {
* Thread commands contain machine-specific data structures suitable for
* use in the thread state primitives. The machine specific data structures
* follow the struct thread_command as follows.
- * Each flavor of machine specific data structure is preceded by an unsigned
- * long constant for the flavor of that data structure, an uint32_t
- * that is the count of longs of the size of the state data structure and then
+ * Each flavor of machine specific data structure is preceded by an uint32_t
+ * constant for the flavor of that data structure, an uint32_t that is the
+ * count of uint32_t's of the size of the state data structure and then
* the state data structure follows. This triple may be repeated for many
* flavors. The constants for the flavors, counts and state data structure
* definitions are expected to be in the header file <machine/thread_status.h>.
* These machine specific data structures sizes must be multiples of
- * 4 bytes The cmdsize reflects the total size of the thread_command
+ * 4 bytes. The cmdsize reflects the total size of the thread_command
* and all of the sizes of the constants for the flavors, counts and state
* data structures.
*
@@ -774,7 +815,7 @@ struct thread_command {
uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */
uint32_t cmdsize; /* total size of this command */
/* uint32_t flavor flavor of thread state */
- /* uint32_t count count of longs in thread state */
+ /* uint32_t count count of uint32_t's in thread state */
/* struct XXX_thread_state state thread state for this flavor */
/* ... */
};
@@ -1149,7 +1190,11 @@ struct rpath_command {
*/
struct linkedit_data_command {
uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
- or LC_FUNCTION_STARTS */
+ LC_FUNCTION_STARTS, LC_DATA_IN_CODE,
+ LC_DYLIB_CODE_SIGN_DRS,
+ LC_LINKER_OPTIMIZATION_HINT,
+ LC_DYLD_EXPORTS_TRIE, or
+ LC_DYLD_CHAINED_FIXUPS. */
uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */
uint32_t dataoff; /* file offset of data in __LINKEDIT segment */
uint32_t datasize; /* file size of data in __LINKEDIT segment */
@@ -1169,17 +1214,74 @@ struct encryption_info_command {
};
/*
+ * The encryption_info_command_64 contains the file offset and size of an
+ * of an encrypted segment (for use in x86_64 targets).
+ */
+struct encryption_info_command_64 {
+ uint32_t cmd; /* LC_ENCRYPTION_INFO_64 */
+ uint32_t cmdsize; /* sizeof(struct encryption_info_command_64) */
+ uint32_t cryptoff; /* file offset of encrypted range */
+ uint32_t cryptsize; /* file size of encrypted range */
+ uint32_t cryptid; /* which enryption system,
+ 0 means not-encrypted yet */
+ uint32_t pad; /* padding to make this struct's size a multiple
+ of 8 bytes */
+};
+
+/*
* The version_min_command contains the min OS version on which this
* binary was built to run.
*/
struct version_min_command {
uint32_t cmd; /* LC_VERSION_MIN_MACOSX or
- LC_VERSION_MIN_IPHONEOS */
+ LC_VERSION_MIN_IPHONEOS or
+ LC_VERSION_MIN_WATCHOS or
+ LC_VERSION_MIN_TVOS */
uint32_t cmdsize; /* sizeof(struct min_version_command) */
uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
- uint32_t reserved; /* zero */
+ uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
+};
+
+/*
+ * The build_version_command contains the min OS version on which this
+ * binary was built to run for its platform. The list of known platforms and
+ * tool values following it.
+ */
+struct build_version_command {
+ uint32_t cmd; /* LC_BUILD_VERSION */
+ uint32_t cmdsize; /* sizeof(struct build_version_command) plus */
+ /* ntools * sizeof(struct build_tool_version) */
+ uint32_t platform; /* platform */
+ uint32_t minos; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ uint32_t ntools; /* number of tool entries following this */
+};
+
+struct build_tool_version {
+ uint32_t tool; /* enum for the tool */
+ uint32_t version; /* version number of the tool */
};
+/* Known values for the platform field above. */
+#define PLATFORM_MACOS 1
+#define PLATFORM_IOS 2
+#define PLATFORM_TVOS 3
+#define PLATFORM_WATCHOS 4
+#define PLATFORM_BRIDGEOS 5
+#define PLATFORM_MACCATALYST 6
+#define PLATFORM_IOSSIMULATOR 7
+#define PLATFORM_TVOSSIMULATOR 8
+#define PLATFORM_WATCHOSSIMULATOR 9
+#define PLATFORM_DRIVERKIT 10
+
+#ifndef __APPLE_BLEACH_SDK__
+#endif /* __APPLE_BLEACH_SDK__ */
+
+/* Known values for the tool field above. */
+#define TOOL_CLANG 1
+#define TOOL_SWIFT 2
+#define TOOL_LD 3
+
/*
* The dyld_info_command contains the file offsets and sizes of
* the new compressed form of the information dyld needs to
@@ -1265,14 +1367,19 @@ struct dyld_info_command {
* Nodes for a symbol start with a uleb128 that is the length of
* the exported symbol information for the string so far.
* If there is no exported symbol, the node starts with a zero byte.
- * If there is exported info, it follows the length. First is
- * a uleb128 containing flags. Normally, it is followed by a
- * uleb128 encoded offset which is location of the content named
+ * If there is exported info, it follows the length.
+ *
+ * First is a uleb128 containing flags. Normally, it is followed by
+ * a uleb128 encoded offset which is location of the content named
* by the symbol from the mach_header for the image. If the flags
* is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is
* a uleb128 encoded library ordinal, then a zero terminated
* UTF8 string. If the string is zero length, then the symbol
* is re-export from the specified dylib with the same name.
+ * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following
+ * the flags is two uleb128s: the stub offset and the resolver offset.
+ * The stub is used by non-lazy pointers. The resolver is used
+ * by lazy pointers and must be called to get the actual address to use.
*
* After the optional exported symbol information is a byte of
* how many edges (0-255) that this node has leaving it,
@@ -1316,6 +1423,7 @@ struct dyld_info_command {
#define BIND_SPECIAL_DYLIB_SELF 0
#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
+#define BIND_SPECIAL_DYLIB_WEAK_LOOKUP -3
#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
@@ -1335,6 +1443,9 @@ struct dyld_info_command {
#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
+#define BIND_OPCODE_THREADED 0xD0
+#define BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB 0x00
+#define BIND_SUBOPCODE_THREADED_APPLY 0x01
/*
@@ -1344,9 +1455,23 @@ struct dyld_info_command {
#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
+#define EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE 0x02
#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
+#define EXPORT_SYMBOL_FLAGS_STATIC_RESOLVER 0x20
+
+
+/*
+ * The linker_option_command contains linker options embedded in object files.
+ */
+struct linker_option_command {
+ uint32_t cmd; /* LC_LINKER_OPTION only used in MH_OBJECT filetypes */
+ uint32_t cmdsize;
+ uint32_t count; /* number of strings */
+ /* concatenation of zero terminated UTF8 strings.
+ Zero filled at end to align */
+};
/*
* The symseg_command contains the offset and size of the GNU style
@@ -1388,6 +1513,50 @@ struct fvmfile_command {
uint32_t header_addr; /* files virtual address */
};
+
+/*
+ * The entry_point_command is a replacement for thread_command.
+ * It is used for main executables to specify the location (file offset)
+ * of main(). If -stack_size was used at link time, the stacksize
+ * field will contain the stack size need for the main thread.
+ */
+struct entry_point_command {
+ uint32_t cmd; /* LC_MAIN only used in MH_EXECUTE filetypes */
+ uint32_t cmdsize; /* 24 */
+ uint64_t entryoff; /* file (__TEXT) offset of main() */
+ uint64_t stacksize;/* if not zero, initial stack size */
+};
+
+
+/*
+ * The source_version_command is an optional load command containing
+ * the version of the sources used to build the binary.
+ */
+struct source_version_command {
+ uint32_t cmd; /* LC_SOURCE_VERSION */
+ uint32_t cmdsize; /* 16 */
+ uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */
+};
+
+
+/*
+ * The LC_DATA_IN_CODE load commands uses a linkedit_data_command
+ * to point to an array of data_in_code_entry entries. Each entry
+ * describes a range of data in a code section.
+ */
+struct data_in_code_entry {
+ uint32_t offset; /* from mach_header to start of data range*/
+ uint16_t length; /* number of bytes in data range */
+ uint16_t kind; /* a DICE_KIND_* value */
+};
+#define DICE_KIND_DATA 0x0001
+#define DICE_KIND_JUMP_TABLE8 0x0002
+#define DICE_KIND_JUMP_TABLE16 0x0003
+#define DICE_KIND_JUMP_TABLE32 0x0004
+#define DICE_KIND_ABS_JUMP_TABLE32 0x0005
+
+
+
/*
* Sections of type S_THREAD_LOCAL_VARIABLES contain an array
* of tlv_descriptor structures.
@@ -1399,4 +1568,39 @@ struct tlv_descriptor
unsigned long offset;
};
-#endif /* _MACHO_LOADER_H_ */
+/*
+ * LC_NOTE commands describe a region of arbitrary data included in a Mach-O
+ * file. Its initial use is to record extra data in MH_CORE files.
+ */
+struct note_command {
+ uint32_t cmd; /* LC_NOTE */
+ uint32_t cmdsize; /* sizeof(struct note_command) */
+ char data_owner[16]; /* owner name for this LC_NOTE */
+ uint64_t offset; /* file offset of this data */
+ uint64_t size; /* length of data region */
+};
+
+/*
+ * LC_FILESET_ENTRY commands describe constituent Mach-O files that are part
+ * of a fileset. In one implementation, entries are dylibs with individual
+ * mach headers and repositionable text and data segments. Each entry is
+ * further described by its own mach header.
+ */
+struct fileset_entry_command {
+ uint32_t cmd; /* LC_FILESET_ENTRY */
+ uint32_t cmdsize; /* includes entry_id string */
+ uint64_t vmaddr; /* memory address of the entry */
+ uint64_t fileoff; /* file offset of the entry */
+ union lc_str entry_id; /* contained entry id */
+ uint32_t reserved; /* reserved */
+};
+
+/*
+ * These deprecated values may still be used within Apple but are mechanically
+ * removed from public API. The mechanical process may produce unusual results.
+ */
+#if (!defined(PLATFORM_IOSMAC))
+#define PLATFORM_IOSMAC PLATFORM_MACCATALYST
+#endif
+
+#endif /* _MACHO_LOADER_H_ */ \ No newline at end of file
diff --git a/src/third_party/mac_headers/mach-o/nlist.h b/src/third_party/mac_headers/mach-o/nlist.h
index 1c194101..7b979a52 100644
--- a/src/third_party/mac_headers/mach-o/nlist.h
+++ b/src/third_party/mac_headers/mach-o/nlist.h
@@ -78,7 +78,7 @@ struct nlist {
#ifndef __LP64__
char *n_name; /* for use when in-core */
#endif
- int32_t n_strx; /* index into the string table */
+ uint32_t n_strx; /* index into the string table */
} n_un;
uint8_t n_type; /* type flag, see below */
uint8_t n_sect; /* section number or NO_SECT */
@@ -296,17 +296,29 @@ struct nlist_64 {
*/
#define N_SYMBOL_RESOLVER 0x0100
+/*
+ * The N_ALT_ENTRY bit of the n_desc field indicates that the
+ * symbol is pinned to the previous content.
+ */
+#define N_ALT_ENTRY 0x0200
+
+/*
+ * The N_COLD_FUNC bit of the n_desc field indicates that the symbol is used
+ * infrequently and the linker should order it towards the end of the section.
+ */
+#define N_COLD_FUNC 0x0400
+
#ifndef __STRICT_BSD__
-#if __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* The function nlist(3) from the C library.
*/
extern int nlist (const char *filename, struct nlist *list);
-#if __cplusplus
+#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __STRICT_BSD__ */
-#endif /* _MACHO_LIST_H_ */
+#endif /* _MACHO_LIST_H_ */ \ No newline at end of file