 STRUCT: section
     { sectname        char[16] }
     { segname         char[16] }
-    { addr            uint32_t }
-    { size            uint32_t }
-    { offset          uint32_t }
-    { align           uint32_t }
-    { reloff          uint32_t }
-    { nreloc          uint32_t }
-    { flags           uint32_t }
-    { reserved1       uint32_t }
-    { reserved2       uint32_t } ;
+    { addr            uint     }
+    { size            uint     }
+    { offset          uint     }
+    { align           uint     }
+    { reloff          uint     }
+    { nreloc          uint     }
+    { flags           uint     }
+    { reserved1       uint     }
+    { reserved2       uint     } ;
 
 STRUCT: section_64
-    { sectname        char[16] }
-    { segname         char[16] }
-    { addr            uint64_t }
-    { size            uint64_t }
-    { offset          uint32_t }
-    { align           uint32_t }
-    { reloff          uint32_t }
-    { nreloc          uint32_t }
-    { flags           uint32_t }
-    { reserved1       uint32_t }
-    { reserved2       uint32_t }
-    { reserved3       uint32_t } ;
+    { sectname        char[16]  }
+    { segname         char[16]  }
+    { addr            ulonglong }
+    { size            ulonglong }
+    { offset          uint      }
+    { align           uint      }
+    { reloff          uint      }
+    { nreloc          uint      }
+    { flags           uint      }
+    { reserved1       uint      }
+    { reserved2       uint      }
+    { reserved3       uint      } ;
 
 CONSTANT: SECTION_TYPE         HEX: 000000ff
 CONSTANT: SECTION_ATTRIBUTES   HEX: ffffff00

CONSTANT: FAT_CIGAM HEX: bebafeca

STRUCT: fat_header
    { magic        uint32_t }
    { nfat_arch    uint32_t } ;

STRUCT: fat_arch
    { cputype      cpu_type_t    }
    { cpusubtype   cpu_subtype_t }
    { offset       uint32_t      }
    { size         uint32_t      }
    { align        uint32_t      } ;

! nlist.h
STRUCT: nlist
    { n_strx  int32_t  }
    { n_type  uint8_t  }
    { n_sect  uint8_t  }
    { n_desc  int16_t  }
    { n_value uint32_t } ;

STRUCT: nlist_64
    { n_strx  uint32_t }
    { n_type  uint8_t  }
    { n_sect  uint8_t  }
    { n_desc  uint16_t }
    { n_value uint64_t } ;

CONSTANT: N_STAB  HEX: e0
CONSTANT: N_PEXT  HEX: 10

! Copyright (C) 2010 Erik Charlebois.
! See http:// factorcode.org/license.txt for BSD license.
USING: alien.c-types alien.syntax classes.struct kernel literals math ;
IN: macho

TYPEDEF: int       integer_t
