diff options
author | sunpoet <sunpoet@FreeBSD.org> | 2017-05-24 02:51:54 +0800 |
---|---|---|
committer | sunpoet <sunpoet@FreeBSD.org> | 2017-05-24 02:51:54 +0800 |
commit | 0090d0c62f9c0c9523ea0f482d78271a16acae6b (patch) | |
tree | bfe23bbd5a84843cb513940d04156a24ae279040 /graphics | |
parent | 66f73422d4e240c8d81535d13c8c6972523abfca (diff) | |
download | freebsd-ports-gnome-0090d0c62f9c0c9523ea0f482d78271a16acae6b.tar.gz freebsd-ports-gnome-0090d0c62f9c0c9523ea0f482d78271a16acae6b.tar.zst freebsd-ports-gnome-0090d0c62f9c0c9523ea0f482d78271a16acae6b.zip |
Fix build on i386
Obtained from: https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e
Thanks to: wen
Diffstat (limited to 'graphics')
3 files changed, 115 insertions, 0 deletions
diff --git a/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp new file mode 100644 index 000000000000..29a17ab5f528 --- /dev/null +++ b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp @@ -0,0 +1,81 @@ +Obtained from: https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e + +--- ogr/ogrsf_frmts/cad/libopencad/cadheader.cpp.orig 2017-04-28 16:07:33 UTC ++++ ogr/ogrsf_frmts/cad/libopencad/cadheader.cpp +@@ -310,14 +310,22 @@ CADVariant::CADVariant( const string& va + { + } + +-CADVariant::CADVariant( time_t val ) : ++CADVariant::CADVariant( long julianday, long milliseconds ) : + type ( DataType::DATETIME ), + decimalVal ( 0 ), + xVal ( 0 ), + yVal ( 0 ), +- zVal ( 0 ), +- dateTimeVal ( val ) ++ zVal ( 0 ) + { ++ // unix -> julian return ( unixSecs / 86400.0 ) + 2440587.5; ++ // julian -> unix return (julian - 2440587.5) * 86400.0 ++ ++ double dfSeconds = double( milliseconds ) / 1000; ++ double dfUnix = 0; ++ if(julianday != 0) ++ dfUnix = ( double( julianday ) - 2440587.5 ) * 86400.0; ++ dateTimeVal = static_cast<time_t>( dfUnix + dfSeconds ); ++ + char str_buff[256]; + strftime(str_buff, 255, "%Y-%m-%d %H:%M:%S", localtime(&dateTimeVal)); + stringVal = str_buff; +@@ -335,33 +343,6 @@ CADVariant::CADVariant( const CADHandle& + { + } + +-CADVariant::CADVariant( const CADVariant& orig ) : +- type ( orig.type ), +- decimalVal ( orig.decimalVal ), +- xVal ( orig.xVal ), +- yVal ( orig.yVal ), +- zVal ( orig.zVal ), +- stringVal ( orig.stringVal ), +- handleVal ( orig.handleVal ), +- dateTimeVal ( orig.dateTimeVal ) +-{ +-} +- +-CADVariant& CADVariant::operator=( const CADVariant& orig ) +-{ +- if( this == & orig ) +- return * this; +- type = orig.type; +- stringVal = orig.stringVal; +- decimalVal = orig.decimalVal; +- xVal = orig.xVal; +- yVal = orig.yVal; +- zVal = orig.zVal; +- handleVal = orig.handleVal; +- dateTimeVal = orig.dateTimeVal; +- return * this; +-} +- + long CADVariant::getDecimal() const + { + return decimalVal; +@@ -461,15 +442,7 @@ int CADHeader::addValue( short code, dou + + int CADHeader::addValue( short code, long julianday, long milliseconds ) + { +- // unix -> julian return ( unixSecs / 86400.0 ) + 2440587.5; +- // julian -> unix return (julian - 2440587.5) * 86400.0 +- +- double dfSeconds = double( milliseconds ) / 1000; +- double dfUnix = 0; +- if(julianday != 0) +- dfUnix = ( double( julianday ) - 2440587.5 ) * 86400.0; +- time_t fullSeconds = static_cast<time_t>( dfUnix + dfSeconds ); +- return addValue( code, CADVariant( fullSeconds ) ); ++ return addValue( code, CADVariant( julianday, milliseconds ) ); + } + + int CADHeader::getGroupCode( short code ) diff --git a/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h new file mode 100644 index 000000000000..d65177340b8a --- /dev/null +++ b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h @@ -0,0 +1,17 @@ +Obtained from: https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e + +--- ogr/ogrsf_frmts/cad/libopencad/cadheader.h.orig 2017-04-28 16:07:33 UTC ++++ ogr/ogrsf_frmts/cad/libopencad/cadheader.h +@@ -79,10 +79,8 @@ public: + // cppcheck-suppress noExplicitConstructor + CADVariant( const std::string& val ); + // cppcheck-suppress noExplicitConstructor +- CADVariant( time_t val ); +-public: +- CADVariant( const CADVariant& orig ); +- CADVariant& operator=( const CADVariant& orig ); ++ CADVariant( long julianday, long milliseconds ); ++ + public: + long getDecimal() const; + double getReal() const; diff --git a/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h new file mode 100644 index 000000000000..d5a0961a1c40 --- /dev/null +++ b/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h @@ -0,0 +1,17 @@ +Obtained from: https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e + +--- ogr/ogrsf_frmts/cad/libopencad/opencad.h.orig 2017-04-28 16:07:33 UTC ++++ ogr/ogrsf_frmts/cad/libopencad/opencad.h +@@ -31,10 +31,10 @@ + #ifndef OPENCAD_H + #define OPENCAD_H + +-#define OCAD_VERSION "0.3.2" ++#define OCAD_VERSION "0.3.3" + #define OCAD_VERSION_MAJOR 0 + #define OCAD_VERSION_MINOR 3 +-#define OCAD_VERSION_REV 2 ++#define OCAD_VERSION_REV 3 + + #ifndef OCAD_COMPUTE_VERSION + #define OCAD_COMPUTE_VERSION(maj,min,rev) ((maj)*10000+(min)*100+rev) // maj - any, min < 99, rev < 99 |