mcpp_2.7.2_az.patch 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. diff --git a/config/config.guess b/config/config.guess
  2. index 396482d..4592806 100755
  3. --- a/config/config.guess
  4. +++ b/config/config.guess
  5. @@ -831,6 +831,9 @@ EOF
  6. arm*:Linux:*:*)
  7. echo ${UNAME_MACHINE}-unknown-linux-gnu
  8. exit ;;
  9. + aarch64:Linux:*:*)
  10. + echo ${UNAME_MACHINE}-unknown-linux-gnu
  11. + exit ;;
  12. avr32*:Linux:*:*)
  13. echo ${UNAME_MACHINE}-unknown-linux-gnu
  14. exit ;;
  15. diff --git a/src/configed.H b/src/configed.H
  16. index b4d1ebf..436bd54 100644
  17. --- a/src/configed.H
  18. +++ b/src/configed.H
  19. @@ -17,10 +17,10 @@
  20. #include "config.h"
  21. -#ifndef COMPILER /* No target compiler specified */
  22. -#define COMPILER COMPILER_UNKNOWN
  23. +#ifndef COMPILER
  24. +#define COMPILER MSC
  25. #endif
  26. -#ifndef HOST_COMPILER /* No host compiler specified */
  27. +#ifndef HOST_COMPILER
  28. #define HOST_COMPILER COMPILER
  29. #endif
  30. diff --git a/src/internal.H b/src/internal.H
  31. index 5e1c19f..94b5a5a 100644
  32. --- a/src/internal.H
  33. +++ b/src/internal.H
  34. @@ -96,7 +96,7 @@
  35. #define OP_LPA 2 /* ( */
  36. /* The following are unary. */
  37. #define FIRST_UNOP OP_PLU /* First unary operator */
  38. -#define OP_PLU 3 /* + */
  39. +#define OP_PLU 3 /* + */
  40. #define OP_NEG 4 /* - */
  41. #define OP_COM 5 /* ~ */
  42. #define OP_NOT 6 /* ! */
  43. @@ -324,7 +324,7 @@ extern struct std_limits_ {
  44. int inc_nest; /* Least maximum of include nest*/
  45. long n_macro; /* Least maximum of num of macro*/
  46. long line_num; /* Maximum source line number */
  47. -} std_limits;
  48. +} std_limits;
  49. /* The boolean flags specified by the execution options. */
  50. extern struct option_flags_ {
  51. int c; /* -C option (keep comments) */
  52. @@ -503,6 +503,8 @@ extern int (* mcpp_fputc)( int c, OUTDEST od),
  53. (* mcpp_fputs)( const char * s, OUTDEST od),
  54. (* mcpp_fprintf)( OUTDEST od, const char * format, ...);
  55. +extern void (*g_report_include)(FILE *, const char *, const char *, const char *);
  56. +
  57. /* system.c */
  58. extern void do_options( int argc, char ** argv, char ** in_pp
  59. , char ** out_pp);
  60. diff --git a/src/main.c b/src/main.c
  61. index a438894..b892f81 100644
  62. --- a/src/main.c
  63. +++ b/src/main.c
  64. @@ -334,7 +334,7 @@ int main
  65. #endif
  66. (
  67. int argc,
  68. - char ** argv
  69. + const char ** argv
  70. )
  71. {
  72. char * in_file = NULL;
  73. diff --git a/src/main_libmcpp.c b/src/main_libmcpp.c
  74. index 7163925..d266c92 100644
  75. --- a/src/main_libmcpp.c
  76. +++ b/src/main_libmcpp.c
  77. @@ -3,7 +3,7 @@
  78. #include "mcpp_lib.h"
  79. int
  80. -main (int argc, char *argv[])
  81. +main (int argc, const char *argv[])
  82. {
  83. return mcpp_lib_main (argc, argv);
  84. }
  85. diff --git a/src/mcpp_lib.def b/src/mcpp_lib.def
  86. index c95f440..b3c10e9 100644
  87. --- a/src/mcpp_lib.def
  88. +++ b/src/mcpp_lib.def
  89. @@ -5,3 +5,4 @@ EXPORTS
  90. mcpp_set_out_func
  91. mcpp_use_mem_buffers
  92. mcpp_get_mem_buffer
  93. + mcpp_set_report_include_callback
  94. diff --git a/src/mcpp_lib.h b/src/mcpp_lib.h
  95. index 4827f0a..64b23ae 100644
  96. --- a/src/mcpp_lib.h
  97. +++ b/src/mcpp_lib.h
  98. @@ -1,3 +1,4 @@
  99. +// # Modifications Copyright (c) Contributors to the Open 3D Engine Project, SPDX-License-Identifier: Apache-2.0 OR MIT
  100. /* mcpp_lib.h: declarations of libmcpp exported (visible) functions */
  101. #ifndef _MCPP_LIB_H
  102. #define _MCPP_LIB_H
  103. @@ -10,7 +11,7 @@
  104. || __MINGW64__
  105. #if DLL_EXPORT || (__CYGWIN__ && PIC)
  106. #define DLL_DECL __declspec( dllexport)
  107. -#elif DLL_IMPORT
  108. +#elif MCPP_DLL_IMPORT
  109. #define DLL_DECL __declspec( dllimport)
  110. #else
  111. #define DLL_DECL
  112. @@ -19,13 +20,31 @@
  113. #define DLL_DECL
  114. #endif
  115. -extern DLL_DECL int mcpp_lib_main( int argc, char ** argv);
  116. -extern DLL_DECL void mcpp_reset_def_out_func( void);
  117. -extern DLL_DECL void mcpp_set_out_func(
  118. - int (* func_fputc) ( int c, OUTDEST od),
  119. - int (* func_fputs) ( const char * s, OUTDEST od),
  120. - int (* func_fprintf)( OUTDEST od, const char * format, ...)
  121. - );
  122. -extern DLL_DECL void mcpp_use_mem_buffers( int tf);
  123. -extern DLL_DECL char * mcpp_get_mem_buffer( OUTDEST od);
  124. +#include <stdio.h>
  125. +
  126. +#ifdef __cplusplus
  127. +extern "C" {
  128. +#endif
  129. +
  130. + extern DLL_DECL int mcpp_lib_main(int argc, const char ** argv);
  131. + extern DLL_DECL void mcpp_reset_def_out_func(void);
  132. + extern DLL_DECL void mcpp_set_out_func(
  133. + int (* func_fputc) ( int c, MCPP_OUTDEST od),
  134. + int (* func_fputs) ( const char * s, MCPP_OUTDEST od),
  135. + int (* func_fprintf)(MCPP_OUTDEST od, const char * format, ...)
  136. + );
  137. + extern DLL_DECL void mcpp_use_mem_buffers( int tf);
  138. + extern DLL_DECL char * mcpp_get_mem_buffer(MCPP_OUTDEST od);
  139. +
  140. + extern DLL_DECL void mcpp_set_report_include_callback(
  141. + void(*report_include)(FILE * fp, /* Open file pointer */
  142. + const char * src_dir, /* Directory of source */
  143. + const char * filename, /* Name of the file */
  144. + const char * fullname) /* Full path */
  145. + );
  146. +
  147. +#ifdef __cplusplus
  148. +}
  149. +#endif
  150. +
  151. #endif /* _MCPP_LIB_H */
  152. diff --git a/src/mcpp_out.h b/src/mcpp_out.h
  153. index 02ba2aa..bf0b82e 100644
  154. --- a/src/mcpp_out.h
  155. +++ b/src/mcpp_out.h
  156. @@ -1,13 +1,23 @@
  157. /* mcpp_out.h: declarations of OUTDEST data types for MCPP */
  158. +// # Modifications Copyright (c) Contributors to the Open 3D Engine Project, SPDX-License-Identifier: Apache-2.0 OR MIT
  159. #ifndef _MCPP_OUT_H
  160. #define _MCPP_OUT_H
  161. /* Choices for output destination */
  162. typedef enum {
  163. - OUT, /* ~= fp_out */
  164. - ERR, /* ~= fp_err */
  165. - DBG, /* ~= fp_debug */
  166. - NUM_OUTDEST
  167. -} OUTDEST;
  168. + MCPP_OUT, /* ~= fp_out */
  169. + MCPP_ERR, /* ~= fp_err */
  170. + MCPP_DBG, /* ~= fp_debug */
  171. + MCPP_NUM_OUTDEST
  172. +} MCPP_OUTDEST;
  173. +
  174. +// O3DE: keep build compatibility with MCPP
  175. +#ifndef MCPP_DONT_USE_SHORT_NAMES
  176. + #define OUT MCPP_OUT
  177. + #define ERR MCPP_ERR
  178. + #define DBG MCPP_DBG
  179. + #define NUM_OUTDEST MCPP_NUM_OUTDEST
  180. + #define OUTDEST MCPP_OUTDEST
  181. +#endif
  182. #endif /* _MCPP_OUT_H */
  183. diff --git a/src/noconfig.H b/src/noconfig.H
  184. index 6b634fe..6482967 100644
  185. --- a/src/noconfig.H
  186. +++ b/src/noconfig.H
  187. @@ -15,18 +15,18 @@
  188. */
  189. /* Define target operating-system. */
  190. -#define SYSTEM SYS_FREEBSD
  191. +#define SYSTEM SYS_WIN
  192. /* Define target compiler. */
  193. #ifndef COMPILER
  194. -#define COMPILER INDEPENDENT /* compiler-independent-build */
  195. +#define COMPILER MSC /* compiler-independent-build */
  196. #endif
  197. /* Define host operating-system. */
  198. #define HOST_SYSTEM SYSTEM
  199. /* Define host compiler. */
  200. -#define HOST_COMPILER GNUC
  201. +#define HOST_COMPILER COMPILER
  202. /* Version message. */
  203. /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
  204. diff --git a/src/support.c b/src/support.c
  205. index c57eaef..c910d86 100644
  206. --- a/src/support.c
  207. +++ b/src/support.c
  208. @@ -364,6 +364,19 @@ void mcpp_set_out_func(
  209. }
  210. #endif
  211. +void (*g_report_include)(FILE *, const char *, const char *, const char *);
  212. +
  213. +void mcpp_set_report_include_callback(
  214. + void(*report_include)(
  215. + FILE * fp, /* Open file pointer */
  216. + const char * src_dir, /* Directory of source */
  217. + const char * filename, /* Name of the file */
  218. + const char * fullname) /* Full path */
  219. +)
  220. +{
  221. + g_report_include = report_include;
  222. +}
  223. +
  224. int get_unexpandable(
  225. int c, /* First char of token */
  226. int diag /* Flag of diagnosis */
  227. @@ -636,7 +649,7 @@ static void scan_id(
  228. if (mcpp_mode == STD && c == '\\' && stdc2) {
  229. int cnt;
  230. char * tp = bp;
  231. -
  232. +
  233. if ((c = get_ch()) == 'u') {
  234. cnt = 4;
  235. } else if (c == 'U') {
  236. @@ -1384,7 +1397,7 @@ static char * scan_op(
  237. } else { /* . */
  238. openum = OP_1;
  239. }
  240. - } else {
  241. + } else {
  242. openum = OP_1;
  243. }
  244. break;
  245. @@ -1654,6 +1667,28 @@ static char * parse_line( void)
  246. size_t com_size;
  247. int c;
  248. + // By O3DE:
  249. + // ---- The Goal:
  250. + // Match the number of lines between the source AZSL files, before preprocessing,
  251. + // and the AZSL files after preprocessing. Line number matching is important because it helps
  252. + // providing accurate line numbers when reporting errors either by AZSLc or DXC.
  253. + //
  254. + // ---- The Problem:
  255. + // MCPP adds a new line after each comment line that starts with '//'
  256. + //
  257. + // ---- Solution:
  258. + // Do not add the extra line ending character '\n'.
  259. + //
  260. + // ---- How:
  261. + // We count here the amount of leading spaces before the first
  262. + // non space character is detected.
  263. + // This is used to decide whether comments are going to be printed out or
  264. + // skipped altogether.
  265. + // If the current line only contains comments, preceded ONLY by whitespaces then
  266. + // will print the comment in the output WITHOUT line ending character. Otherwise
  267. + // the comment won't make it into the output.
  268. + int NumLeadingSpaces = 0;
  269. +
  270. if ((sp = get_line( FALSE)) == NULL) /* Next logical line */
  271. return NULL; /* End of a file */
  272. if (in_asm) { /* In #asm block */
  273. @@ -1668,9 +1703,12 @@ static char * parse_line( void)
  274. while (char_type[ c = *sp++ & UCHARMAX] & HSP) {
  275. if (mcpp_mode != POST_STD)
  276. + { // O3DE
  277. /* Preserve line top horizontal white spaces */
  278. /* as they are for human-readability */
  279. *tp++ = c;
  280. + ++NumLeadingSpaces; //O3DE
  281. + } // O3DE
  282. /* Else skip the line top spaces */
  283. }
  284. sp--;
  285. @@ -1719,9 +1757,15 @@ com_start:
  286. cwarn( "Parsed \"//\" as comment" /* _W2_ */
  287. , NULL, 0L, NULL);
  288. if (keep_comments) {
  289. - sp -= 2;
  290. - while (*sp != '\n') /* Until end of line */
  291. - mcpp_fputc( *sp++, OUT);
  292. + const int numCharactersBeforeComment = (tp - temp);
  293. + if (numCharactersBeforeComment == NumLeadingSpaces)
  294. + {
  295. + // O3DE: It is safe to print the comments
  296. + sp -= 2;
  297. + while (*sp != '\n') /* Until end of line */
  298. + mcpp_fputc( *sp++, OUT);
  299. + // mcpp_fputc('\n', OUT); // Removed by O3DE. This prevents that each comment line from presenting additional empty lines.
  300. + }
  301. }
  302. goto end_line;
  303. default: /* Not a comment */
  304. @@ -1821,7 +1865,7 @@ static char * read_a_comment(
  305. if (keep_spaces) {
  306. saved_sp = sp - 2; /* '-2' for beginning / and * */
  307. *sizp = 0;
  308. - }
  309. + }
  310. if (keep_comments) /* If writing comments */
  311. mcpp_fputs( "/*", OUT); /* Write the initializer*/
  312. c = *sp++;
  313. @@ -1911,7 +1955,7 @@ static char * get_line(
  314. /*
  315. * ANSI (ISO) C: translation phase 1, 2.
  316. * Get the next logical line from source file.
  317. - * Convert [CR+LF] to [LF].
  318. + * Convert [CR+LF] to [LF].
  319. */
  320. {
  321. #if COMPILER == INDEPENDENT
  322. diff --git a/src/system.c b/src/system.c
  323. index 4759469..5bccf62 100644
  324. --- a/src/system.c
  325. +++ b/src/system.c
  326. @@ -303,7 +303,7 @@ static char * mkdep_mt; /* Argument of -MT option */
  327. /* sharp_filename is filename for #line line, used only in cur_file() */
  328. static char * sharp_filename = NULL;
  329. static char * argv0; /* argv[ 0] for usage() and version() */
  330. -static int ansi; /* __STRICT_ANSI__ flag for GNUC */
  331. +static int ansi; /* __STRICT_ANSI__ flag for GNUC */
  332. static int compat_mode;
  333. /* "Compatible" mode of recursive macro expansion */
  334. #define MAX_ARCH_LEN 16
  335. @@ -530,7 +530,7 @@ plus:
  336. compat_mode = TRUE; /* 'compatible' mode */
  337. mcpp_mode = STD;
  338. }
  339. - else
  340. + else
  341. usage( opt);
  342. standard = (mcpp_mode == STD || mcpp_mode == POST_STD);
  343. if (old_mode != STD && old_mode != mcpp_mode)
  344. @@ -837,7 +837,7 @@ plus:
  345. /* Fall through */
  346. case 'k':
  347. option_flags.k = TRUE;
  348. - /* Keep white spaces of input lines as they are */
  349. + /* Keep white spaces of input lines as they are */
  350. break;
  351. #if COMPILER == GNUC
  352. @@ -1739,7 +1739,7 @@ static void def_a_macro(
  353. skip_nl(); /* Clear the appended <newline> */
  354. }
  355. -static void chk_opts(
  356. +static void chk_opts(
  357. int sflag, /* Flag of Standard or post-Standard mode */
  358. int trad /* -traditional (GCC only) */
  359. )
  360. @@ -2239,7 +2239,7 @@ static void set_sys_dirs(
  361. set_a_dir( "/usr/local/include");
  362. #endif
  363. -#ifdef C_INCLUDE_DIR1
  364. +#ifdef C_INCLUDE_DIR1
  365. set_a_dir( C_INCLUDE_DIR1);
  366. #endif
  367. #ifdef C_INCLUDE_DIR2
  368. @@ -2301,7 +2301,7 @@ static void set_a_dir(
  369. #if SYSTEM == SYS_MAC
  370. to_search_framework = &incdir[ framework_pos];
  371. #endif
  372. - max_inc *= 2;
  373. + max_inc *= 2;
  374. }
  375. if (dirname == NULL)
  376. @@ -2392,7 +2392,7 @@ static char * norm_dir(
  377. if (! norm_name && option_flags.v)
  378. mcpp_fprintf( ERR, "Invalid header map file \"%s\" is ignored\n"
  379. , dirname);
  380. - } else
  381. + } else
  382. #endif
  383. {
  384. norm_name = norm_path( dirname, NULL, FALSE, FALSE);
  385. @@ -2642,7 +2642,7 @@ static char * norm_path(
  386. } else { /* Impossible */
  387. break;
  388. }
  389. - } else { /* Impossible */
  390. + } else { /* Impossible */
  391. break;
  392. }
  393. }
  394. @@ -2769,7 +2769,7 @@ static void init_gcc_macro( void)
  395. && scan_token( skip_ws(), (tp = work_buf, &tp), work_end)
  396. == NAM
  397. && str_eq( work_buf, "define")) {
  398. - defp = do_define( TRUE, nargs); /* Ignore re-definition */
  399. + defp = do_define( TRUE, nargs); /* Ignore re-definition */
  400. }
  401. skip_nl();
  402. }
  403. @@ -2981,7 +2981,7 @@ void put_depend(
  404. }
  405. static char * md_init(
  406. - const char * filename, /* The source file name */
  407. + const char * filename, /* The source file name */
  408. char * output /* Output to dependency file */
  409. )
  410. /*
  411. @@ -3288,7 +3288,7 @@ static int has_directory(
  412. )
  413. /*
  414. * If a directory is found in the 'source' filename string (i.e. "includer"),
  415. - * the directory part of the string is copied to 'directory' and
  416. + * the directory part of the string is copied to 'directory' and
  417. * has_directory() returns TRUE.
  418. * Else, nothing is copied and it returns FALSE.
  419. */
  420. @@ -3320,7 +3320,7 @@ static int is_full_path(
  421. #if SYS_FAMILY == SYS_UNIX
  422. if (path[0] == PATH_DELIM)
  423. #elif SYS_FAMILY == SYS_WIN
  424. - if ((path[1] == ':' && path[2] == PATH_DELIM) /* "C:/path" */
  425. + if ((path[1] == ':' && (path[2] == PATH_DELIM || path[2] == '\\')) /* "C:/path" */
  426. || path[0] == PATH_DELIM) /* Root dir of current drive */
  427. #elif 1
  428. /* For other systems you should write code here. */
  429. @@ -3432,7 +3432,7 @@ search:
  430. return FALSE;
  431. if (standard && included( fullname)) /* Once included */
  432. goto true;
  433. -
  434. +
  435. if ((max_open != 0 && max_open <= include_nest)
  436. /* Exceed the known limit of open files */
  437. || ((fp = fopen( fullname, "r")) == NULL && errno == EMFILE)) {
  438. @@ -3462,7 +3462,7 @@ search:
  439. }
  440. if (max_open == 0) /* Remember the limit of the system */
  441. max_open = include_nest;
  442. - } else if (fp == NULL) /* No read permission */
  443. + } else if (fp == NULL) /* No read permission */
  444. goto false;
  445. /* Truncate buffer of the includer to save memory */
  446. len = (int) (file->bptr - file->buffer);
  447. @@ -3480,6 +3480,8 @@ search:
  448. * Note: inc_dirp is restored to the parent includer's directory
  449. * by get_ch() when the current includer is finished.
  450. */
  451. + if (g_report_include)
  452. + g_report_include(fp, src_dir, filename, fullname);
  453. infile->dirp = inc_dirp = dirp;
  454. #if 0 /* This part is only for debugging */
  455. chk_dirp( dirp);
  456. @@ -3762,7 +3764,7 @@ static int search_framework(
  457. return TRUE;
  458. }
  459. - *cp2 = PATH_DELIM; /* Restore original include file format */
  460. + *cp2 = PATH_DELIM; /* Restore original include file format */
  461. return FALSE;
  462. }
  463. @@ -3858,6 +3860,28 @@ static int chk_dirp(
  464. }
  465. #endif
  466. +char* mincs_ifnotnull(char* p1, char* p2)
  467. +{
  468. + if (!p1) return p2;
  469. + if (!p2) return p1;
  470. + return p1 < p2 ? p1 : p2;
  471. +}
  472. +
  473. +/* extract directory part of a file path */
  474. +static char g_space[1024];
  475. +char * dir_of(const char* path)
  476. +{
  477. + const char * lastsep = mincs_ifnotnull(strrchr(path, PATH_DELIM),
  478. + strrchr(path, '\\'));
  479. + if (!lastsep) return NULL;
  480. + if (lastsep - path >= 1024)
  481. + cfatal("path too long encountered. %s", path, 0L, NULL);
  482. +
  483. + strncpy(g_space, path, lastsep - path + 1);
  484. + g_space[lastsep - path + 1] = 0;
  485. + return g_space;
  486. +}
  487. +
  488. void sharp(
  489. FILEINFO * sharp_file,
  490. int flag /* Flag to append to the line for GCC */
  491. @@ -3910,17 +3934,34 @@ static void cur_file(
  492. if (mcpp_debug & MACRO_CALL) { /* In macro notification mode */
  493. if (sharp_file) /* Main input file */
  494. - name = file->filename;
  495. + name = file->full_fname;
  496. else /* Output full-path-list, normalized */
  497. name = cur_fullname;
  498. } else { /* Usually, the path not "normalized" */
  499. if (sharp_file) { /* Main input file */
  500. name = file->filename;
  501. } else if (str_eq( file->filename, file->real_fname)) {
  502. - sprintf( work_buf, "%s%s", *(file->dirp), cur_fname);
  503. - name = work_buf;
  504. + name = file->full_fname; // O3DE: absolute paths required
  505. } else { /* Changed by '#line fname' directive */
  506. - name = file->filename;
  507. + if (!is_full_path(file->filename)) { // O3DE: this block does the best it can to get real full paths.
  508. + name = dir_of(cur_fullname); // extract first part of path
  509. + if (!name) // no directory found in cur_fullname (weird case)
  510. + name = file->filename;
  511. + else {
  512. + sprintf( work_buf, "%s%s", name, file->filename);
  513. + FILE* reachable = fopen(work_buf, "r");
  514. + if (reachable) {
  515. + name = norm_path(null, work_buf, FALSE, FALSE);
  516. + fclose(reachable);
  517. + } else { // non reachable file encountered
  518. + name = file->filename; // input verbatim
  519. + }
  520. + }
  521. + if (strlen(name) == 0)
  522. + name = file->filename; // as is
  523. + } else { // absolute path already
  524. + name = file->filename;
  525. + }
  526. }
  527. }
  528. if (sharp_filename == NULL || ! str_eq( name, sharp_filename)) {
  529. diff --git a/src/testmain.c b/src/testmain.c
  530. index 33e47b3..ce3e00d 100644
  531. --- a/src/testmain.c
  532. +++ b/src/testmain.c
  533. @@ -13,7 +13,7 @@
  534. #include "mcpp_lib.h"
  535. -int main(int argc, char *argv[])
  536. +int main(int argc, const char *argv[])
  537. {
  538. int i, j;
  539. char ** tmp_argv;