some Makefile and hints tinkering

1. remove all window interface bits from compiler.370, and have
   the preceding include files set some variables to control
   the behavior of compiler.370 when it comes to c++.
2. some more common Makefile lines into sys/unix/hints/include/multiw-3.370.
3. make it so you can pass cppregex=1 on the Make command line to build with
   sys/share/cppregex.cpp instead of posixregex.c
4. fix sys/share/cppregex.cpp so that it will build with clang compiler
   (required an additional header include). I don't know if it would have
   worked with g++ without that change. The include can be placed into an #ifdef
   block if there's an issue with the change on other compilers.
5. Anything that needs to compile using c++ (Qt, sys/share/cppregex.cpp) can
   just ensure that CPLUSPLUS_NEEDED Makefile variable is set above the lines
   in compiler.370 to ensure that things get set up for c++. It no longer
   checks specifically for Qt. That is what sys/unix/hints/include/multiw-2.370
   does now.
This commit is contained in:
nhmall
2022-11-13 22:25:07 -05:00
parent d957d70d15
commit 3f93d54b66
8 changed files with 211 additions and 166 deletions

View File

@@ -14,7 +14,7 @@ extern char *fmt_ptr(const void *) NONNULL;
/* This next pre-processor directive covers almost the entire file,
* interrupted only occasionally to pick up specific functions as needed. */
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(CPPREGEX_C)
/* ### allmain.c ### */
@@ -782,9 +782,11 @@ extern void done1(int);
extern int done2(void);
extern void done_in_by(struct monst *, int);
extern void done_object_cleanup(void);
#endif /* !MAKEDEFS_C && MDLIB_C */
#endif /* !MAKEDEFS_C && MDLIB_C && !CPPREGEX_C */
#if !defined(CPPREGEX_C)
extern void panic(const char *, ...) PRINTF_F(1, 2) NORETURN;
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
#endif
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(CPPREGEX_C)
extern void done(int);
extern void container_contents(struct obj *, boolean, boolean, boolean);
extern void nh_terminate(int) NORETURN;
@@ -1377,7 +1379,7 @@ extern void clear_level_structures(void);
extern void level_finalize_topology(void);
extern void mklev(void);
#ifdef SPECIALIZATION
extern void topologize(struct mkroom *, boolean));
extern void topologize(struct mkroom *, boolean);
#else
extern void topologize(struct mkroom *);
#endif
@@ -1855,6 +1857,7 @@ extern char *stripdigits(char *);
extern const char *get_lua_version(void);
extern void nhl_pushhooked_open_table(lua_State *L);
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
#endif /* MAKEDEFS_C MDLIB_C CPPREGEX_C */
/* ### nhregex.c ### */
@@ -1864,6 +1867,8 @@ extern char *regex_error_desc(struct nhregex *, char *);
extern boolean regex_match(const char *, struct nhregex *);
extern void regex_free(struct nhregex *);
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C) && !defined(CPPREGEX_C)
/* ### consoletty.c ### */
#ifdef WIN32