From: <arj...@us...> - 2008-10-22 04:25:34
|
Revision: 8953 http://plplot.svn.sourceforge.net/plplot/?rev=8953&view=rev Author: arjenmarkus Date: 2008-10-22 04:25:30 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Changes to the Fortran 77 and 95 bindings because of support for the latest gfortran version under MinGW. This also cleans up a few oddities in the interface (notably sc3d.c). Added an export definitions file for F77. This was required for CVF. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plstubs.h trunk/bindings/f77/sc3d.c trunk/bindings/f95/plplotf95.def trunk/bindings/f95/plstubs.h trunk/bindings/f95/sc3d.c trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f77/CMakeLists.txt 2008-10-22 04:25:30 UTC (rev 8953) @@ -35,7 +35,7 @@ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f COMMAND sed -f ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 > ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f - DEPENDS + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ) @@ -129,6 +129,10 @@ configurable.f ) +if(WIN32 AND BUILD_SHARED_LIBS) + SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) +endif(WIN32 AND BUILD_SHARED_LIBS) + add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f77/plplotf77.def 2008-10-22 04:25:30 UTC (rev 8953) @@ -1,54 +1,30 @@ +EXPORTS _PLABORT@8 _PLAXES@40 - _PLBIN@12 _PLBOX3@72 _PLBOX@32 _PLCON0@36 _PLCON1@44 _PLCON2@44 - _PLCONT@32 - _PLCPSTRM@8 - _PLERRX@12 - _PLERRY@12 - _PLFILL3@12 - _PLFILL@8 + _PLCONT@36 _PLGDEV@8 _PLGFNAM@8 - _PLGRIDDATA@32 + _PLSFNAM@8 _PLGVER@8 - _PLHIST@20 - _PLIMAGE@44 _PLIMAGEFR0@48 _PLIMAGEFR1@56 _PLIMAGEFR2@56 _PLIMAGEFR@48 _PLLAB@24 - _PLLINE3@12 - _PLLINE@8 _PLMAP@28 _PLMERIDIANS@28 - _PLMESH@16 - _PLMESHC@20 _PLMTEX3@28 _PLMTEX@28 - _PLOT3D@20 - _PLOT3DC@20 _PLPARSEOPTS@4 - _PLPOIN3@16 - _PLPOIN@12 - _PLPOLY3@20 _PLPTEX3@48 _PLPTEX@28 - _PLSCMAP0@12 - _PLSCMAP0A@16 - _PLSCMAP1@12 - _PLSCMAP1L2@20 - _PLSCMAP1L@24 - _PLSCMAP1LA2@24 - _PLSCMAP1LA@28 - _PLSDEV7@4 - _PLSETOPT7@8 - _PLSFNAM7@4 + _PLSDEV@8 + _PLSETOPT@16 _PLSHADE0@76 _PLSHADE1@84 _PLSHADE2@84 @@ -59,16 +35,9 @@ _PLSHADES@60 _PLSPAUSE@4 _PLSTART@16 - _PLSTRF2C@16 _PLSTRC2F@16 _PLSTRIPC@104 - _PLSURF3D@20 - _PLSVECT@12 - _PLSYM@12 _PLTIMEFMT@8 _PLVEC0@20 _PLVEC1@28 _PLVEC2@28 - _PLXORMOD@8 -EXPORTS -LIBRARY plplotf77d.dll Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f77/plstubs.h 2008-10-22 04:25:30 UTC (rev 8953) @@ -53,6 +53,7 @@ #define STUB_U 3 #define STUB_FORTRAN 4 #define STUB_STDCALL 5 +#define STUB_MINGW 6 #ifndef STUB_LINKAGE @@ -99,6 +100,8 @@ #define STUB_LINKAGE STUB_FORTRAN #elif defined(_MSC_VER) #define STUB_LINKAGE STUB_STDCALL +#elif defined(__GNUC__) /* GNU C with MinGW/Cygwin */ +#define STUB_LINKAGE STUB_MINGW #endif #elif defined(MSDOS) /* MS-DOS based */ #define STUB_LINKAGE STUB_FORTRAN @@ -125,7 +128,7 @@ #define FNAME_(x,y) y #elif STUB_LINKAGE == STUB_U -#define FNAME(x,y) x +#define FNAME(x,y) PLDLLIMPEXP_F77C __stdcall x #define FNAME_(x,y) x #elif STUB_LINKAGE == STUB_FORTRAN @@ -136,6 +139,10 @@ #define FNAME(x,y) PLDLLIMPEXP_F77C __stdcall x #define FNAME_(x,y) x +#elif STUB_LINKAGE == STUB_MINGW +#define FNAME(x,y) PLDLLIMPEXP_F77C y##_ +#define FNAME_(x,y) y + #else #error "Illegal setting for STUB_LINKAGE" #endif Modified: trunk/bindings/f77/sc3d.c =================================================================== --- trunk/bindings/f77/sc3d.c 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f77/sc3d.c 2008-10-22 04:25:30 UTC (rev 8953) @@ -25,7 +25,7 @@ #include "plstubs.h" void -PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z, +PLOT3DC__(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *nx, PLINT *ny, PLINT *opt, PLFLT *clevel, PLINT *nlevel, PLINT *lx) { @@ -48,6 +48,14 @@ } void +PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx) +{ + PLOT3DC__(x, y, z, nx, ny, opt, clevel, nlevel, lx); +} + +void PLSURF3D(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *nx, PLINT *ny, PLINT *opt, PLFLT *clevel, PLINT *nlevel, PLINT *lx) @@ -97,7 +105,7 @@ PLFLT clevel = 0.; optlocal = *opt | MESH; - PLOT3DC_(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); } void @@ -107,7 +115,7 @@ { PLINT optlocal; optlocal = *opt | MESH; - PLOT3DC_(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx); } @@ -119,6 +127,6 @@ PLFLT clevel = 0.; optlocal = *opt | (*side == 1 ? DRAW_SIDES : 0); - PLOT3DC_(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); } Modified: trunk/bindings/f95/plplotf95.def =================================================================== --- trunk/bindings/f95/plplotf95.def 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f95/plplotf95.def 2008-10-22 04:25:30 UTC (rev 8953) @@ -48,13 +48,17 @@ _PLPLOT_mp_PLGRIDDATA@32 _PLPLOT_mp_PLHIST@20 _PLPLOT_mp_PLIMAGE@44 - _PLPLOT_mp_PLIMAGEFR@52 + _PLPLOTP_mp_PLIMAGEFR_0@36 + _PLPLOTP_mp_PLIMAGEFR_1@44 + _PLPLOTP_mp_PLIMAGEFR_2@44 + _PLPLOTP_mp_PLIMAGEFR_TR@40 _PLPLOT_mp_PLLINE@8 _PLPLOT_mp_PLLINE3@12 _PLPLOT_mp_PLMESH@16 _PLPLOT_mp_PLMESHC@20 _PLPLOT_mp_PLOT3D@20 _PLPLOT_mp_PLOT3DC@20 + _PLPLOT_mp_PLRANDD@0 _PLPLOT_mp_PLSPAUSE@4 _PLPLOT_mp_PLSURF3D@20 _PLPLOT_mp_PLPOIN@12 Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f95/plstubs.h 2008-10-22 04:25:30 UTC (rev 8953) @@ -53,6 +53,7 @@ #define STUB_U 3 #define STUB_FORTRAN 4 #define STUB_STDCALL 5 +#define STUB_MINGW 6 #ifndef STUB_LINKAGE @@ -94,15 +95,17 @@ #ifdef IVF /* Intel Visual Fortran */ #define STUB_LINKAGE STUB_U #elif defined(CVF) -#define STUB_LINKAGE_STUB_U +#define STUB_LINKAGE STUB_U +#elif defined(MSDOS) +#define STUB_LINKAGE STUB_FORTRAN #elif defined(_MSC_VER) #define STUB_LINKAGE STUB_STDCALL -#else -#define STUB_LINKAGE STUB_STDCALL +#elif defined(__GNUC__) +#define STUB_LINKAGE STUB_MINGW #endif -#elif defined(MSDOS) +#elif defined(MSDOS) /* MS-DOS based */ #define STUB_LINKAGE STUB_FORTRAN -#endif +#endif /* Windows 32-bit */ #ifndef STUB_LINKAGE /* The default */ #define STUB_LINKAGE STUB_LAU @@ -118,18 +121,27 @@ #if STUB_LINKAGE==STUB_LAU #define FNAME(x,y) PLDLLIMPEXP_F95C y##_ +#define FNAME_(x,y) y##_ #elif STUB_LINKAGE == STUB_L #define FNAME(x,y) y +#define FNAME_(x,y) y #elif STUB_LINKAGE == STUB_U #define FNAME(x,y) x +#define FNAME_(x,y) x +#elif STUB_LINKAGE == STUB_FORTRAN +#define FNAME(x,y) fortran x +#define FNAME_(x,y) x + #elif STUB_LINKAGE == STUB_STDCALL #define FNAME(x,y) PLDLLIMPEXP_F95C __stdcall x +#define FNAME_(x,y) x -#elif STUB_LINKAGE == STUB_FORTRAN -#define FNAME(x,y) fortran x +#elif STUB_LINKAGE == STUB_MINGW +#define FNAME(x,y) PLDLLIMPEXP_F95C y##_ +#define FNAME_(x,y) y #else #error "Illegal setting for STUB_LINKAGE" Modified: trunk/bindings/f95/sc3d.c =================================================================== --- trunk/bindings/f95/sc3d.c 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f95/sc3d.c 2008-10-22 04:25:30 UTC (rev 8953) @@ -25,7 +25,7 @@ #include "plstubs.h" void -PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z, +PLOT3DC__(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *nx, PLINT *ny, PLINT *opt, PLFLT *clevel, PLINT *nlevel, PLINT *lx) { @@ -48,6 +48,14 @@ } void +PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z, + PLINT *nx, PLINT *ny, PLINT *opt, + PLFLT *clevel, PLINT *nlevel, PLINT *lx) +{ + PLOT3DC__(x, y, z, nx, ny, opt, clevel, nlevel, lx); +} + +void PLSURF3D(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *nx, PLINT *ny, PLINT *opt, PLFLT *clevel, PLINT *nlevel, PLINT *lx) @@ -97,7 +105,7 @@ PLFLT clevel = 0.; optlocal = *opt | MESH; - CALL_PLOT3DC(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); } void @@ -107,7 +115,7 @@ { PLINT optlocal; optlocal = *opt | MESH; - CALL_PLOT3DC(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx); } @@ -119,6 +127,6 @@ PLFLT clevel = 0.; optlocal = *opt | (*side != 0 ? DRAW_SIDES : 0); - CALL_PLOT3DC(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); + PLOT3DC__(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx); } Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f95/scstubs.c 2008-10-22 04:25:30 UTC (rev 8953) @@ -300,7 +300,7 @@ c_plgfam(fam, num, bmax); } -/* Note: Fortran does not have unsigned integers so we need to use a +/* Note: Fortran does not have unsigned integers so we need to use a * 64 bit signed integer which corresponds to a fortran integer*8 * in order to contain the number. */ void @@ -829,9 +829,10 @@ c_plsfam(*fam, *num, *bmax); } -/* Note: Fortran does not have unsigned integers so we need to use a +/* Note: Fortran does not have unsigned integers so we need to use a * 64 bit signed integer which corresponds to a fortran integer*8 * in order to contain the number. */ +/* PLSFCI(PLINT64 *fci) */ void PLSFCI(PLINT64 *fci) { Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2008-10-22 02:24:26 UTC (rev 8952) +++ trunk/bindings/f95/sfstubsf95.f90 2008-10-22 04:25:30 UTC (rev 8953) @@ -372,7 +372,7 @@ use plplot_flt integer(kind=plunicode) :: fci end subroutine plgfci - end interface + end interface interface subroutine plgfont( family, style, weight ) @@ -739,7 +739,7 @@ use plplot_flt integer(kind=plunicode) :: fci end subroutine plsfci - end interface + end interface interface subroutine plsfont( family, style, weight ) @@ -1006,20 +1006,20 @@ call plhistf77( size(data), data, datmin, datmax, nbin, oldwin ) end subroutine plhist -! subroutine plimagefr( idata, xmin, xmax, ymin, ymax, zmin, zmax, & -! dxmin, dxmax, dymin, dymax, valuemin, valuemax ) -! real(kind=plflt), dimension(:,:) :: idata -! real(kind=plflt) :: xmin, xmax, ymin, ymax, zmin, zmax +! subroutine plimagefr( idata, xmin, xmax, ymin, ymax, zmin, zmax, & +! dxmin, dxmax, dymin, dymax, valuemin, valuemax ) +! real(kind=plflt), dimension(:,:) :: idata +! real(kind=plflt) :: xmin, xmax, ymin, ymax, zmin, zmax ! real(kind=plflt) :: dxmin, dxmax, dymin, dymax, & ! valuemin, valuemax ! -! integer :: nx, ny +! integer :: nx, ny ! -! nx = size(idata,1) -! ny = size(idata,2) -! call plimagefrf77( idata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, & -! dxmin, dxmax, dymin, dymax, valuemin, valuemax ) -! end subroutine plimagefr +! nx = size(idata,1) +! ny = size(idata,2) +! call plimagefrf77( idata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, & +! dxmin, dxmax, dymin, dymax, valuemin, valuemax ) +! end subroutine plimagefr subroutine plimage( idata, xmin, xmax, ymin, ymax, zmin, zmax, & dxmin, dxmax, dymin, dymax ) @@ -1032,7 +1032,7 @@ nx = size(idata,1) ny = size(idata,2) call plimagef77( idata, nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, & - dxmin, dxmax, dymin, dymax, nx ) + dxmin, dxmax, dymin, dymax ) end subroutine plimage subroutine plline( x, y ) @@ -1136,7 +1136,7 @@ enddo call plpoly3f77( size(x), x, y, z, idraw, iifcc ) end subroutine plpoly3 - + real (kind=plflt) function plrandd() external plranddf77 real(kind=plflt) :: plranddf77 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |