From eb6ccdaad857caa975d31dc274352ac0f5bb4c42 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 28 Oct 2012 13:41:50 +0100 Subject: [PATCH] Fixed: MFC tools compilation with STLport --- .../3d/ligo/plugin_max/ligoscape_utility.def | 2 +- code/nel/tools/3d/ligo/plugin_max/script.cpp | 8 ++++++++ .../tools/3d/plugin_max/nel_export/std_afx.h | 17 ++++++++++++++++- .../tools/3d/plugin_max/nel_mesh_lib/StdAfx.h | 1 + .../3d/plugin_max/nel_mesh_lib/export_misc.cpp | 8 ++++++++ .../nel_patch_converter/nel_patch_converter.def | 2 +- .../plugin_max/nel_patch_converter/script.cpp | 12 ++++++++++++ .../nel_patch_edit/nel_patch_edit.def | 2 +- .../3d/plugin_max/nel_patch_edit_adv/mods.def | 2 +- .../3d/plugin_max/nel_patch_edit_adv/stdafx.h | 2 ++ .../tools/3d/plugin_max/nel_patch_lib/stdafx.h | 2 ++ .../nel_patch_paint/nel_patch_paint.def | 2 +- .../nel_vertex_tree_paint/vertex_tree_paint.def | 2 +- .../3d/plugin_max/tile_utility/tile_utility.def | 2 +- .../3d/plugin_max/tile_utility/tile_utility.h | 2 ++ code/nel/tools/misc/data_mirror/StdAfx.h | 3 +++ .../leveldesign/georges_dll/header_dialog.cpp | 2 +- 17 files changed, 62 insertions(+), 9 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def index 18beb72e0..c3f1a6b7c 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.def @@ -1,4 +1,4 @@ -LIBRARY nelligoscapeutility.dlx +;LIBRARY nelligoscapeutility.dlx EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/ligo/plugin_max/script.cpp b/code/nel/tools/3d/ligo/plugin_max/script.cpp index 7763a0126..41740bcbe 100644 --- a/code/nel/tools/3d/ligo/plugin_max/script.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/script.cpp @@ -18,6 +18,14 @@ #include +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif + // Various MAX and MXS includes #include #if MAX_VERSION_MAJOR >= 14 diff --git a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h index c9ce76d89..9b4b18357 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/std_afx.h +++ b/code/nel/tools/3d/plugin_max/nel_export/std_afx.h @@ -14,6 +14,19 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +#ifndef STDAFX_H +#define STDAFX_H + +#include + +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif + #include #include #include @@ -36,7 +49,7 @@ # include # include # include -# include +# include #else # include # include @@ -58,3 +71,5 @@ #endif #include "nel/misc/bsphere.h" + +#endif diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h index dfbd11915..cb2cec48f 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/StdAfx.h @@ -49,6 +49,7 @@ #include #include +#include #include "../nel_patch_lib/rpo.h" #include "nel/misc/time_nl.h" diff --git a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp index 8dbaeb56b..44f51fc75 100644 --- a/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp +++ b/code/nel/tools/3d/plugin_max/nel_mesh_lib/export_misc.cpp @@ -27,6 +27,14 @@ using namespace NLMISC; using namespace NL3D; +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f) { return ::fabsf(f); } + double fabsl(double f) { return ::fabsl(f); } +} +#endif + // *************************************************************************** // -------------------------------------------------- diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def index a6cecd424..c3a249d4a 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.def @@ -1,4 +1,4 @@ -LIBRARY nelconvertpatch.dlm +;LIBRARY nelconvertpatch.dlm EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp index 6ee1c43f1..c2e80e06b 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/script.cpp @@ -19,7 +19,19 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif + +#include + +#ifdef _STLPORT_VERSION +namespace std +{ + float fabsf(float f); + double fabsl(double f); +} +#endif #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def b/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def index 607869257..c01fdf4e9 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/nel_patch_edit.def @@ -1,4 +1,4 @@ -LIBRARY neleditpatch +;LIBRARY neleditpatch EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def index f3b941802..d3759424e 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/mods.def @@ -1,4 +1,4 @@ -LIBRARY neleditpatchadv +;LIBRARY neleditpatchadv EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h index 14e542a3f..9045b4b53 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit_adv/stdafx.h @@ -1,4 +1,6 @@ #pragma warning (disable : 4786) + +#include #include #include #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h index 85d489147..db03395e8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h +++ b/code/nel/tools/3d/plugin_max/nel_patch_lib/stdafx.h @@ -17,7 +17,9 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif #pragma warning (disable : 4786) #include diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def index 59c2e5d46..ddb039e28 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.def @@ -1,4 +1,4 @@ -LIBRARY nelpaintpatch.dlm +;LIBRARY nelpaintpatch.dlm EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def index 1c3524d1c..dcd6d1e33 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.def @@ -1,4 +1,4 @@ -LIBRARY nel_vertex_tree_paint +;LIBRARY nel_vertex_tree_paint EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def index 6a8b07e45..8fe710a8f 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.def @@ -1,4 +1,4 @@ -LIBRARY neltileutility.dlu +;LIBRARY neltileutility.dlu EXPORTS LibDescription @1 LibNumberClasses @2 diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h index ade41e486..5d5e4e298 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.h @@ -20,7 +20,9 @@ #pragma conform(forScope, push) #pragma conform(forScope, off) +#ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE +#endif #include #include diff --git a/code/nel/tools/misc/data_mirror/StdAfx.h b/code/nel/tools/misc/data_mirror/StdAfx.h index a065be4ed..90fe14511 100644 --- a/code/nel/tools/misc/data_mirror/StdAfx.h +++ b/code/nel/tools/misc/data_mirror/StdAfx.h @@ -10,6 +10,9 @@ #pragma once #endif // _MSC_VER > 1000 +#include "nel/misc/types_nl.h" +#include "nel/misc/file.h" + #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include // MFC core and standard components diff --git a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp index a69d481f4..6ecfe13fc 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp @@ -263,7 +263,7 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header) if (end) { // Build a string - int length = std::min (31, end-start); + int length = std::min (31, (int)(end-start)); memcpy (name, start, length); name[length] = 0;