Changeset 84054 in vbox for trunk/src/VBox/Runtime/win
- Timestamp:
- Apr 28, 2020 4:05:00 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137633
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/win/errmsgwin-sorter.cpp
r83984 r84054 39 39 40 40 41 #define ERRMSG_WITH_STRTAB 42 #ifdef ERRMSG_WITH_STRTAB 43 /* 44 * Include the string table code. 45 */ 46 # define BLDPROG_STRTAB_MAX_STRLEN 512 47 # define BLDPROG_STRTAB_WITH_COMPRESSION 48 # define BLDPROG_STRTAB_PURE_ASCII 49 # define BLDPROG_STRTAB_WITH_CAMEL_WORDS 50 # include <iprt/bldprog-strtab-template.cpp.h> 51 #endif 52 53 41 54 /********************************************************************************************************************************* 42 55 * Defined Constants And Macros * … … 57 70 * Global Variables * 58 71 *********************************************************************************************************************************/ 72 static const char *g_pszProgName = "errmsgwin-sorter"; 59 73 static RTWINERRMSG g_aStatusMsgs[] = 60 74 { … … 67 81 { "Success.", "ERROR_SUCCESS", 0 }, 68 82 }; 83 84 85 static RTEXITCODE error(const char *pszFormat, ...) 86 { 87 va_list va; 88 va_start(va, pszFormat); 89 fprintf(stderr, "%s: error: ", g_pszProgName); 90 vfprintf(stderr, pszFormat, va); 91 va_end(va); 92 return RTEXITCODE_FAILURE; 93 } 69 94 70 95 … … 156 181 if (pOut) 157 182 { 183 #ifdef ERRMSG_WITH_STRTAB 184 /* 185 * String table fun. 186 */ 187 static BLDPROGSTRING s_aStrings[RT_ELEMENTS(g_aStatusMsgs) * 2]; 188 size_t iString = 0; 189 BLDPROGSTRTAB StrTab; 190 if (!BldProgStrTab_Init(&StrTab, RT_ELEMENTS(s_aStrings))) 191 return error("Out of memory!\n"); 192 #endif 193 158 194 /* 159 195 * Print the table. … … 184 220 iPrev = pMsg->iCode; 185 221 222 #ifdef ERRMSG_WITH_STRTAB 223 # if 1 224 s_aStrings[iString].pszString = strdup(pMsg->pszDefine); 225 BldProgStrTab_AddString(&StrTab, &s_aStrings[iString]); 226 iString++; 227 # endif 228 # if 0 229 s_aStrings[iString].pszString = strdup(pMsg->pszMsgFull); 230 BldProgStrTab_AddString(&StrTab, &s_aStrings[iString]); 231 iString++; 232 # endif 233 #endif 234 186 235 /* Produce the output: */ 187 236 fprintf(pOut, "/*%#010lx:*/ ENTRY(\"%s\", \"%s\", %ld),\n", (unsigned long)pMsg->iCode, … … 197 246 rcExit = RTEXITCODE_FAILURE; 198 247 } 248 249 #ifdef ERRMSG_WITH_STRTAB 250 /* 251 * More string table fun. 252 */ 253 if (!BldProgStrTab_CompileIt(&StrTab, true)) 254 return error("BldProgStrTab_CompileIt failed!\n"); 255 #endif 199 256 } 200 257 else
Note:
See TracChangeset
for help on using the changeset viewer.