Skip to contentSkip to conversation

define memdup() static

PATCH New Hagen Paul Pfeifer 1 participant 1 message Feb 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 define memdup() static

memdup() is only referenced from dwarves.c. This patch defines them static. Further symbol hiding can be accomplished via GCC attributes:

#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)

# define DWARVES_NO_EXPORT __attribute__((visibility("hidden")))
#else
# define DWARVES_NO_EXPORT
#endif
---
 dwarves.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dwarves.c +1 -1
index 813c67b..aa9510e 100644
@@ -114,7 +114,7 @@ static void *zalloc(const size_t size)
 	return s;
 }
 
-void *memdup(const void *src, size_t len)
+static void *memdup(const void *src, size_t len)
 {
 	void *s = malloc(len);
 	if (s != NULL)
Signature · 1 line
1.5.3.8