Bug 12534 - nlist() needs to be handled differently in Mac OS X
Summary: nlist() needs to be handled differently in Mac OS X
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/other (show other bugs)
Version: 7.2 (2007.02)
Hardware: PowerPC Mac OS X (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-23 13:28 UTC by Peter Dyballa
Modified: 2007-09-24 14:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to correct handling of nlist() in Mac OS X (483 bytes, text/plain)
2007-09-23 13:30 UTC, Peter Dyballa
no flags Details

Description Peter Dyballa 2007-09-23 13:28:32 UTC
When compiling app/xload/get_load.c in Mac OS X 10.4.10 (Tiger) I get:

	get_load.c: In function ‘InitLoadPoint’:
	get_load.c:932: error: conflicting types for ‘nlist’
	/usr/include/nlist.h:104: error: previous declaration of ‘nlist’ was here
	make[1]: *** [xload-get_load.o] Error 1
	make: *** [all] Error 2
	***** make failed on app/xload

Reason is that in line #931 the #if statement is incomplete:

	#if !defined(SVR4) && !defined(sgi) && !defined(MOTOROLA) && !defined(AIXV5) && !(BSD >= 199103)

So nlist() gets re-defined. This is better:

	#if !defined(SVR4) && !defined(sgi) && !defined(MOTOROLA) && !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__)


--- app/xload/get_load.c-orig	2007-09-22 10:18:22.000000000 +0200
+++ app/xload/get_load.c	2007-09-23 20:54:36.000000000 +0200
@@ -928,7 +928,7 @@
 	nl[i].n_value = (int)nl[i].n_value - v.v_kvoffset;
     }
 #else /* not macII */
-#if !defined(SVR4) && !defined(sgi) && !defined(MOTOROLA) && !defined(AIXV5) && !(BSD >= 199103)
+#if !defined(SVR4) && !defined(sgi) && !defined(MOTOROLA) && !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__)
     extern void nlist();
 #endif
Comment 1 Peter Dyballa 2007-09-23 13:30:52 UTC
Created attachment 11704 [details]
Patch to correct handling of nlist() in Mac OS X
Comment 2 Alan Coopersmith 2007-09-24 14:14:29 UTC
Fix committed to git master - thanks for the patch:

commit 5c043a1cec89e884593f541f59b8abd237d91e50
Author: Peter Dyballa <Peter_Dyballa@Freenet.DE>
Date:   Mon Sep 24 14:13:39 2007 -0700

    Bug #12534: nlist() needs to be handled differently in Mac OS X
    
    X.Org Bugzilla #12534 <https://bugs.freedesktop.org/show_bug.cgi?id=12534>
    Patch #11704 <https://bugs.freedesktop.org/attachment.cgi?id=11704>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.