Permalink
Browse files

Made some stuff compiler-specific

  • Loading branch information...
1 parent e9d712f commit 3671e7e653d617b0d1289fc6e7ec85855e40d5ac @nickgammon committed Sep 27, 2010
Showing with 6 additions and 1 deletion.
  1. +4 −0 TextView.cpp
  2. +2 −1 TextView.h
View
@@ -1712,6 +1712,8 @@ pCmdUI->Enable ();
}
+#if _MSC_VER <= 1400
+
#define VERSION_6 MAKELONG(0, 6)
// from Worstje
@@ -1817,6 +1819,8 @@ void CTextView::WriteToArchive(CArchive& ar)
ASSERT_VALID(this);
}
+#endif // _MSC_VER <= 1400
+
void CTextView::SerializeRaw(CArchive& ar)
// Read/Write object as stand-alone file.
{
View
@@ -52,10 +52,11 @@ class CTextView : public CEditView
CString & result,
int & count);
-
+#if _MSC_VER <= 1400
virtual void Serialize(CArchive& ar);
virtual void ReadFromArchive(CArchive& ar, UINT nLen);
virtual void WriteToArchive(CArchive& ar);
+#endif // _MSC_VER <= 1400
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextView)

1 comment on commit 3671e7e

Contributor

worstje commented on 3671e7e Sep 28, 2010

Am looking over your commits, and thank you for the efforts you are putting in. I would have dug into the compiler stuffs and made a proper patch myself, but I haven't had the time just yet. :)

I got a few suggestions to make though... (Sorry for crap code samples, no matter what I do github messes up my source code due to the # thingies.)

  1. VS2005 has the bug fixed if I understand Twisol correct. Therefore, the proper #if clauses would be...

    if _MSC_VER < 1400

    // Stuff that fixes your bug.

    else /* #if _MSC_VER >= 1400 */

    // Calling the ordinary routines.

    endif

As it is right now, you still seem to apply the bugfix to VS2005.

  1. With everything properly #if'ed, you can fix the includes that caused this entire discussion to look like...

    if _MSC_VER < 1400 // doesn't work with Visual Studio 6

    include <../src/afximpl.h>

    endif

After all, the later versions do not fix any MFC bugs and thus do not need linking into the MFC guts.

If you want to keep the different compilers synchronized header-wise, I guess it would be a valid reason, but I do prefer to have VS2005 and later serve as a 'sanity check' that we do not 'accidentally' end up abusing more of the MFC innards that might break across compilers.

Please sign in to comment.