From: <ai...@us...> - 2011-03-16 08:18:25
|
Revision: 11628 http://plplot.svn.sourceforge.net/plplot/?rev=11628&view=rev Author: airwin Date: 2011-03-16 08:18:19 +0000 (Wed, 16 Mar 2011) Log Message: ----------- Replace HAVE_PTHREAD ==> PL_HAVE_PTHREAD HAVE_QHULL ==> PL_HAVE_QHULL everywhere to avoid nameclash with HAVE_PTHREAD and HAVE_QHULL macros defined in the Octave headers. This change gets rid of two compiler warning messages. Modified Paths: -------------- trunk/README.release trunk/bindings/python/plplotcmodule.i trunk/bindings/tk/tkMain.c trunk/cmake/modules/csiro.cmake trunk/cmake/modules/summary.cmake trunk/cmake/modules/xwin.cmake trunk/config.h.cmake trunk/drivers/xwin.c trunk/include/plxwd.h trunk/lib/nn/CMakeLists.txt trunk/src/CMakeLists.txt trunk/src/plgridd.c Modified: trunk/README.release =================================================================== --- trunk/README.release 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/README.release 2011-03-16 08:18:19 UTC (rev 11628) @@ -41,9 +41,10 @@ results if you use these stream variables directly (only possible in C/C++) or use plgvpw. -IV. As of release 5.9.2 we have set HAVE_PTHREAD to ON by default for all -platforms other than Darwin. Darwin will follow later once it appears the -Apple version of X supports it. +IV. As of release 5.9.2 we have set HAVE_PTHREAD (now called +PL_HAVE_PTHREAD as of release 5.9.8) to ON by default for all +platforms other than Darwin. Darwin will follow later once it appears +the Apple version of X supports it. V. As of release 5.9.3 our build system requires CMake version 2.6.0 or higher. Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/bindings/python/plplotcmodule.i 2011-03-16 08:18:19 UTC (rev 11628) @@ -926,7 +926,7 @@ /* grab the Global Interpreter Lock to be sure threads don't mess us up */ MY_BLOCK_THREADS /* build the argument list */ -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD px = PyArray_SimpleNewFromData(1, &nn, NPY_PLFLT,(void *)x); py = PyArray_SimpleNewFromData(1, &nn, NPY_PLFLT,(void *)y); #else Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/bindings/tk/tkMain.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -185,7 +185,7 @@ char buf[20]; int code; -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD XInitThreads(); #endif Modified: trunk/cmake/modules/csiro.cmake =================================================================== --- trunk/cmake/modules/csiro.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/csiro.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -19,14 +19,14 @@ # Module for determining all configuration variables for the CSIRO libraries. -option(HAVE_QHULL "Enable use of the Qhull library" ON) +option(PL_HAVE_QHULL "Enable use of the Qhull library" ON) option(WITH_CSA "Enable use of the csa library" ON) # This logic copied verbatim from csiro.ac for ix86 systems and alpha systems # with two possible compilers. In future, this logic will need to be # expanded to a lot more cases as we gain platform experience. set(NAN_CFLAGS ${CMAKE_C_FLAGS}) -if(HAVE_QHULL OR WITH_CSA) +if(PL_HAVE_QHULL OR WITH_CSA) if(CMAKE_SYSTEM_PROCESSOR MATCHES "i[0-9]86") set(NAN_CFLAGS "${NAN_CFLAGS} -mieee-fp") else(CMAKE_SYSTEM_PROCESSOR MATCHES "i[0-9]86") @@ -57,8 +57,8 @@ ) else(NaNAwareCCompiler) message(STATUS "Check for NaN awareness in C compiler - not found") - message(STATUS "WARNING: Setting HAVE_QHULL and WITH_CSA to OFF.") - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + message(STATUS "WARNING: Setting PL_HAVE_QHULL and WITH_CSA to OFF.") + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) set(WITH_CSA OFF CACHE BOOL "Enable use of the csa library" FORCE) file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining whether C compiler is NaN aware failed with " @@ -66,9 +66,9 @@ ) endif(NaNAwareCCompiler) endif(NOT DEFINED NaNAwareCCompiler) -endif(HAVE_QHULL OR WITH_CSA) +endif(PL_HAVE_QHULL OR WITH_CSA) -if(HAVE_QHULL) +if(PL_HAVE_QHULL) find_package(QHULL) if(QHULL_FOUND) include(CheckFunctionExists) @@ -82,13 +82,13 @@ filter_rpath(QHULL_RPATH) message(STATUS "QHULL_RPATH = ${QHULL_RPATH}") else(QH_NEW_EXIST) - message(STATUS "WARNING: function qh_new_qhull not found. Setting HAVE_QHULL to OFF.") - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + message(STATUS "WARNING: function qh_new_qhull not found. Setting PL_HAVE_QHULL to OFF.") + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) endif(QH_NEW_EXIST) else(QHULL_FOUND) message(STATUS - "WARNING: qhull library not found. Setting HAVE_QHULL to OFF." + "WARNING: qhull library not found. Setting PL_HAVE_QHULL to OFF." ) - set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) + set(PL_HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE) endif(QHULL_FOUND) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) Modified: trunk/cmake/modules/summary.cmake =================================================================== --- trunk/cmake/modules/summary.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/summary.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -105,8 +105,8 @@ BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS} PL_DOUBLE: ${PL_DOUBLE} Optional libraries: -HAVE_QHULL: ${HAVE_QHULL} WITH_CSA: ${WITH_CSA} -HAVE_FREETYPE: ${HAVE_FREETYPE} HAVE_PTHREAD: ${HAVE_PTHREAD} +PL_HAVE_QHULL: ${PL_HAVE_QHULL} WITH_CSA: ${WITH_CSA} +HAVE_FREETYPE: ${HAVE_FREETYPE} PL_HAVE_PTHREAD: ${PL_HAVE_PTHREAD} HAVE_AGG: ${HAVE_AGG} Language Bindings: Modified: trunk/cmake/modules/xwin.cmake =================================================================== --- trunk/cmake/modules/xwin.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/cmake/modules/xwin.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -25,26 +25,26 @@ # device. # xwin_LINK_FLAGS - individual LINK_FLAGS for dynamic xwin device. # DRIVERS_LINK_FLAGS - list of LINK_FLAGS for all static devices. -# HAVE_PTHREAD - ON means use pthreads with xwin driver. +# PL_HAVE_PTHREAD - ON means use pthreads with xwin driver. # PLPLOT_MUTEX_RECURSIVE - Portable definition for PTHREAD_MUTEX_RECURSIVE if(PLD_xwin) if(X11_FOUND) set(xwin_COMPILE_FLAGS "${X11_COMPILE_FLAGS}") set(xwin_LINK_FLAGS "${X11_LIBRARIES}") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # turn HAVE_PTHREAD OFF by default for Mac OS X since it doesn't + # turn PL_HAVE_PTHREAD OFF by default for Mac OS X since it doesn't # work for Mac OS X 10.4. Werner says it does work for vanilla # XQuartz X11, but the official Apple version of X(Quartz) for 10.5 # doesn't have all the fixes of the vanilla version so he doesn't trust # it. This his advice for now is to be conservative until we can # get a clear report that official X works for 10.5. - option(HAVE_PTHREAD "Use pthreads with the xwin driver" OFF) + option(PL_HAVE_PTHREAD "Use pthreads with the xwin driver" OFF) else(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # Turn HAVE_PTHREAD ON by default for other platforms now that + # Turn PL_HAVE_PTHREAD ON by default for other platforms now that # the tk segmentation fault has been cured. - option(HAVE_PTHREAD "Use pthreads with the xwin driver" ON) + option(PL_HAVE_PTHREAD "Use pthreads with the xwin driver" ON) endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - if(HAVE_PTHREAD) + if(PL_HAVE_PTHREAD) find_package(Threads) if(CMAKE_USE_PTHREADS_INIT) set(xwin_LINK_FLAGS ${xwin_LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}) @@ -60,9 +60,9 @@ # I am being super-careful here to follow the autotools model. In # fact, it is possible other thread systems will work as well as # pthreads. So something to investigate for later. - set(HAVE_PTHREAD OFF) + set(PL_HAVE_PTHREAD OFF) endif(CMAKE_USE_PTHREADS_INIT) - endif(HAVE_PTHREAD) + endif(PL_HAVE_PTHREAD) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${xwin_LINK_FLAGS}) else(X11_FOUND) set(PLD_xwin OFF CACHE BOOL "Enable xwin device" FORCE) Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/config.h.cmake 2011-03-16 08:18:19 UTC (rev 11628) @@ -125,10 +125,10 @@ #cmakedefine HAVE_NSGETARGC // Define if pthreads is available -#cmakedefine HAVE_PTHREAD +#cmakedefine PL_HAVE_PTHREAD // Define if Qhull is available -#cmakedefine HAVE_QHULL +#cmakedefine PL_HAVE_QHULL // Define to 1 if you have the <stdlib.h> header file. #cmakedefine HAVE_STDLIB_H 1 Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/drivers/xwin.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -35,7 +35,7 @@ #include "drivers.h" #include "plevent.h" -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD #include <pthread.h> #include <signal.h> int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int kind ); @@ -259,13 +259,13 @@ pls->dev_fastimg = 1; // is a fast image device pls->dev_xor = 1; // device support xor mode -#ifndef HAVE_PTHREAD +#ifndef PL_HAVE_PTHREAD usepthreads = 0; #endif plParseDrvOpts( xwin_options ); -#ifndef HAVE_PTHREAD +#ifndef PL_HAVE_PTHREAD if ( usepthreads ) plwarn( "You said you want pthreads, but they are not available." ); #endif @@ -304,7 +304,7 @@ plP_setpxl( pxlx, pxly ); plP_setphy( xmin, xmax, ymin, ymax ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) { pthread_mutexattr_t mutexatt; @@ -363,7 +363,7 @@ dbug_enter( "plD_line_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -384,7 +384,7 @@ if ( dev->write_to_pixmap ) XDrawLine( xwd->display, dev->pixmap, dev->gc, x1, y1, x2, y2 ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -435,7 +435,7 @@ dbug_enter( "plD_polyline_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -456,7 +456,7 @@ XDrawLines( xwd->display, dev->pixmap, dev->gc, pts, npts, CoordModeOrigin ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -481,7 +481,7 @@ dbug_enter( "plD_eop_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -493,7 +493,7 @@ if ( dev->is_main && !pls->nopause ) WaitForPage( pls ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -513,7 +513,7 @@ dbug_enter( "plD_bop_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -532,7 +532,7 @@ XSync( xwd->display, 0 ); pls->page++; -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -552,7 +552,7 @@ dbug_enter( "plD_tidy_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) { pthread_mutex_lock( &events_mutex ); @@ -603,7 +603,7 @@ dbug_enter( "plD_state_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -676,7 +676,7 @@ break; } -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -717,7 +717,7 @@ { dbug_enter( "plD_esc_xw" ); -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_lock( &events_mutex ); #endif @@ -788,7 +788,7 @@ break; } -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) pthread_mutex_unlock( &events_mutex ); #endif @@ -976,7 +976,7 @@ xwd->nstreams = 1; // Open display -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD if ( usepthreads ) if ( !XInitThreads() ) plexit( "xwin: XInitThreads() not successful." ); @@ -1310,7 +1310,7 @@ // //-------------------------------------------------------------------------- -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD static void events_thread( void *pls ) { Modified: trunk/include/plxwd.h =================================================================== --- trunk/include/plxwd.h 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/include/plxwd.h 2011-03-16 08:18:19 UTC (rev 11628) @@ -9,7 +9,7 @@ #include "plplot.h" #include "plstrm.h" -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD #include <pthread.h> #endif @@ -104,7 +104,7 @@ XPoint xhair_x[2], xhair_y[2]; // Crosshair lines void ( *MasterEH )( PLStream *, XEvent * ); // Master X event handler -#ifdef HAVE_PTHREAD +#ifdef PL_HAVE_PTHREAD pthread_t updater; // The X events updater thread id #endif } XwDev; Modified: trunk/lib/nn/CMakeLists.txt =================================================================== --- trunk/lib/nn/CMakeLists.txt 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/lib/nn/CMakeLists.txt 2011-03-16 08:18:19 UTC (rev 11628) @@ -19,7 +19,7 @@ # along with PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if(HAVE_QHULL) +if(PL_HAVE_QHULL) set(csironn_LIB_SRCS delaunay.c @@ -61,4 +61,4 @@ install(FILES README DESTINATION ${DOC_DIR} RENAME README.nn) install(FILES README.1st DESTINATION ${DOC_DIR} RENAME README.1st.nn) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/src/CMakeLists.txt 2011-03-16 08:18:19 UTC (rev 11628) @@ -220,7 +220,7 @@ ) endif(WITH_CSA) -if(HAVE_QHULL) +if(PL_HAVE_QHULL) set( libplplot${LIB_TAG}_LINK_LIBRARIES ${libplplot${LIB_TAG}_LINK_LIBRARIES} @@ -244,7 +244,7 @@ # Needed by the traditional pkg-config approach for installed examples # as well as the new CMake-based build system for the installed examples. set(LIB_INSTALL_RPATH ${LIB_INSTALL_RPATH} ${QHULL_RPATH}) -endif(HAVE_QHULL) +endif(PL_HAVE_QHULL) if(NOT ENABLE_DYNDRIVERS AND PLD_cgm) list(APPEND libplplot${LIB_TAG}_LINK_LIBRARIES nistcd) Modified: trunk/src/plgridd.c =================================================================== --- trunk/src/plgridd.c 2011-03-15 19:13:08 UTC (rev 11627) +++ trunk/src/plgridd.c 2011-03-16 08:18:19 UTC (rev 11628) @@ -30,7 +30,7 @@ #endif #include "../lib/csa/nan.h" // this is handy -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL #include "../lib/nn/nn.h" #include <qhull/qhull_a.h> #endif @@ -58,7 +58,7 @@ PLF2OPS zops, PLPointer zgp ); #endif -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL static void grid_nni( const PLFLT *x, const PLFLT *y, const PLFLT *z, int npts, const PLFLT *xg, int nptsx, const PLFLT *yg, int nptsy, @@ -180,7 +180,7 @@ break; case ( GRID_DTLI ): // Delaunay Triangulation Linear Interpolation -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL grid_dtli( x, y, z, npts, xg, nptsx, yg, nptsy, zops, zgp ); #else plwarn( "plgriddata(): you must have the Qhull library installed to use GRID_DTLI.\n Reverting to GRID_NNAIDW." ); @@ -189,7 +189,7 @@ break; case ( GRID_NNI ): // Natural Neighbors -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL grid_nni( x, y, z, npts, xg, nptsx, yg, nptsy, zops, zgp, data ); #else plwarn( "plgriddata(): you must have the Qhull library installed to use GRID_NNI.\n Reverting to GRID_NNAIDW." ); @@ -557,7 +557,7 @@ } } -#ifdef HAVE_QHULL +#ifdef PL_HAVE_QHULL // // Delaunay Triangulation Linear Interpolation using Pavel Sakov's nn package // @@ -715,7 +715,7 @@ free( pin ); free( pgrid ); } -#endif // HAVE_QHULL +#endif // PL_HAVE_QHULL // // this function just calculates the K Nearest Neighbors of grid point This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |