--- src/graph/graphqt.cpp.orig	Thu Jul 15 19:59:53 2004
+++ src/graph/graphqt.cpp	Sat Nov  6 20:15:22 2004
@@ -102,6 +102,10 @@
 #  include <io.h>
 #endif
 
+#ifdef __APPLE__
+#  include <sys/sysctl.h>
+#endif
+
 #if LANGTCL
 #  include "dblang.h"
   Tcl_Interp *gra_tclinterp;
@@ -2359,8 +2363,22 @@
  */
 INTBIG enumprocessors(void)
 {
+#ifdef __APPLE__
+   int ctlName[ 2 ], numproc, result;
+   size_t numSize;
+
+   ctlName[ 0 ] = CTL_HW;
+   ctlName[ 1 ] = HW_NCPU;
+   numSize = sizeof( numproc );
+   result = sysctl( ctlName, 2, &numproc, &numSize, NULL, 0 );
+   if( result == 0 )
+       return( (INTBIG) numproc );
+   else
+       return( 1 );
+#else
 #ifdef ONUNIX
 	return(sysconf(_SC_NPROCESSORS_ONLN));
+#endif
 #endif
 #ifdef MACOS
 	return(MPProcessors());
