[93339] trunk/base/src/machista1.0/libmachista.c
jmr at macports.org
jmr at macports.org
Sun May 20 09:48:16 PDT 2012
Revision: 93339
https://trac.macports.org/changeset/93339
Author: jmr at macports.org
Date: 2012-05-20 09:48:12 -0700 (Sun, 20 May 2012)
Log Message:
-----------
don't compile static functions in libmachista when they are unused on non-mach
Modified Paths:
--------------
trunk/base/src/machista1.0/libmachista.c
Modified: trunk/base/src/machista1.0/libmachista.c
===================================================================
--- trunk/base/src/machista1.0/libmachista.c 2012-05-20 14:37:07 UTC (rev 93338)
+++ trunk/base/src/machista1.0/libmachista.c 2012-05-20 16:48:12 UTC (rev 93339)
@@ -81,6 +81,7 @@
HashMap *result_map;
};
+#ifdef __MACH__
/* Verify that the given range is within bounds. */
static const void *macho_read (macho_input_t *input, const void *address, size_t length) {
if ((((uint8_t *) address) - ((uint8_t *) input->data)) + length > input->length) {
@@ -96,6 +97,7 @@
void *result = ((uint8_t *) address) + offset;
return macho_read(input, result, length);
}
+#endif
/* return a human readable formatted version number. the result must be free()'d. */
char *macho_format_dylib_version (uint32_t version) {
@@ -116,6 +118,7 @@
#endif
}
+#ifdef __MACH__
/* Some byteswap wrappers */
static uint32_t macho_swap32 (uint32_t input) {
return OSSwapInt32(input);
@@ -157,6 +160,7 @@
memset(mlt, 0, sizeof(macho_loadcmd_t));
return mlt;
}
+#endif
/* Frees a previously allocated macho_loadcmd_t and all it's associated resources */
static void free_macho_loadcmd_t (macho_loadcmd_t *mlt) {
@@ -199,6 +203,7 @@
free(mt);
}
+#ifdef __MACH__
/* Creates a new element in the architecture list of a macho_t (mt_archs), increases the counter of
* architectures (mt_arch_count) and returns a pointer to the newly allocated element or NULL on
* error */
@@ -228,6 +233,7 @@
return mat->mat_loadcmds;
}
+#endif
/* Parse a Mach-O header */
static int parse_macho (macho_t *mt, macho_input_t *input) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120520/2ce06a08/attachment.html>
More information about the macports-changes
mailing list