+#if HAVE_LIBAPPLEFILE
+ if (hdr->extend_type == EXTEND_MACOS && !verify_mode && decode_macbinary_contents) {
+ /* build temporary file */
+ tfp = NULL; /* avoid compiler warnings `uninitialized' */
+ tfp = build_temporary_file();
+
+ crc = decode_lzhuf(afp, tfp,
+ hdr->original_size, hdr->packed_size,
+ name, method, &read_size);
+ fclose(tfp);
+ decode_macbinary(fp, hdr->original_size, name);
+#ifdef __APPLE__
+ /* TODO: set resource fork */
+ /* after processing, "Icon\r" is not needed. */
+ if (strcmp(basename(name), "Icon\r") == 0) {
+ unlink(name);
+ }
+#endif /* __APPLE__ */
+ unlink(temporary_name);
+ } else {
+ crc = decode_lzhuf(afp, fp,
+ hdr->original_size, hdr->packed_size,
+ name, method, &read_size);
+ }
+#else /* HAVE_LIBAPPLEFILE */