Ticket #6379: gcc4archiving.patch
File gcc4archiving.patch, 1.5 KB (added by , 14 years ago) |
---|
-
src/kits/support/Archivable.cpp
57 57 58 58 out = ""; 59 59 60 #if __GNUC__ >= 4 61 if (name[0] == 'N') 62 name++; 63 int nameLen; 64 bool first = true; 65 while ((nameLen = strtoul(name, (char**)&name, 10))) { 66 if (!first) 67 out += "::"; 68 else 69 first = false; 70 out.Append(name, nameLen); 71 name += nameLen; 72 } 73 if (first) 74 return B_BAD_VALUE; 75 76 #else 60 77 if (name[0] == 'Q') { 61 78 // The name is in a namespace 62 79 int namespaceCount = 0; … … 87 104 88 105 int nameLength = strtoul(name, (char**)&name, 10); 89 106 out.Append(name, nameLength); 107 #endif 90 108 91 109 return B_OK; 92 110 } … … 116 134 } 117 135 118 136 // Now mangle it into this: 137 // 9testthree8testfour9Testthree8Testfour 138 // (for __GNUC__ > 2) 139 // this isn't always the proper mangled class name, it should 140 // actually have an 'N' prefix and 'E' suffix if the name is 141 // in > 0 namespaces, but these would have to be removed in 142 // build_function_name() (the only place this function is called) 143 // so we don't add them. 144 // or this: 119 145 // Q49testthree8testfour9Testthree8Testfour 146 // (for __GNUC__ == 2) 147 120 148 out = ""; 149 #if __GNUC__ == 2 121 150 if (count > 1) { 122 151 out += 'Q'; 123 152 if (count > 10) … … 126 155 if (count > 10) 127 156 out += '_'; 128 157 } 158 #endif 129 159 130 160 for (unsigned int i = 0; i < spacenames.size(); ++i) { 131 161 out << (int)spacenames[i].length();