fork download
  1. #ifdef _MSC_VER
  2. #define IMPLEMENT_SERIALIZE(statements) \
  3.   unsigned int GetSerializeSize(int nType, int nVersion) const \
  4.   { \
  5.   CSerActionGetSerializeSize ser_action; \
  6.   const bool fGetSize = true; \
  7.   const bool fWrite = false; \
  8.   const bool fRead = false; \
  9.   unsigned int nSerSize = 0; \
  10.   ser_streamplaceholder s; \
  11.   assert(fGetSize||fWrite||fRead); /* suppress warning */ \
  12.   s.nType = nType; \
  13.   s.nVersion = nVersion; \
  14.   std::map<int, int> mapUnkIds; \
  15.   {statements} \
  16.   return nSerSize; \
  17.   } \
  18.   template<typename Stream> \
  19.   void Serialize(Stream& s, int nType, int nVersion) const \
  20.   { \
  21.   CSerActionSerialize ser_action; \
  22.   const bool fGetSize = false; \
  23.   const bool fWrite = true; \
  24.   const bool fRead = false; \
  25.   unsigned int nSerSize = 0; \
  26.   assert(fGetSize||fWrite||fRead); /* suppress warning */ \
  27.   std::map<int, int> mapUnkIds; \
  28.   {statements} \
  29.   } \
  30.   template<typename Stream> \
  31.   void Unserialize(Stream& s, int nType, int nVersion) \
  32.   { \
  33.   CSerActionUnserialize ser_action; \
  34.   const bool fGetSize = false; \
  35.   const bool fWrite = false; \
  36.   const bool fRead = true; \
  37.   unsigned int nSerSize = 0; \
  38.   std::map<int, int> mapUnkIds; \
  39.   assert(fGetSize||fWrite||fRead); /* suppress warning */ \
  40.   {statements} \
  41.   }
  42.  
  43. #else
  44. <тот код который был раньше>
  45.  
  46. ......................
  47. #ifdef _MSC_VER
  48. void insert(iterator it, const_iterator first, const_iterator last)
  49. {
  50. assert(last - first >= 0);
  51. if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
  52. {
  53. // special case for inserting at the front when there's room
  54. nReadPos -= (last - first);
  55. memcpy(&vch[nReadPos], &first[0], last - first);
  56. }
  57. else
  58. vch.insert(it, first, last);
  59. }
  60. #endif
  61.  
  62. #ifndef _MSC_VER
  63. void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
  64. {
  65. assert(last - first >= 0);
  66. if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
  67. {
  68. // special case for inserting at the front when there's room
  69. nReadPos -= (last - first);
  70. memcpy(&vch[nReadPos], &first[0], last - first);
  71. }
  72. else
  73. vch.insert(it, first, last);
  74. }
  75. #endif
  76. ...............
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:0: error: unterminated #else
 #ifdef _MSC_VER
 ^
stdout
Standard output is empty