Fix gcc10/clang link errors by adding "extern" to exported variables and defining...
authorggn <ggn.dbug@gmail.com>
Sun, 7 Jun 2020 16:24:13 +0000 (19:24 +0300)
committerShamus Hammons <jlhamm@acm.org>
Sat, 4 Jul 2020 15:52:32 +0000 (10:52 -0500)
dsp56k_amode.c
dsp56k_amode.h

index 347886f6dcb5b1e4359abd84daf71f5fc04f87f7..7937b106b87c54623bdaffdb17d665d4679b980a 100644 (file)
@@ -21,7 +21,7 @@
 #include "mntab.h"
 
 // Address-mode information
-int nmodes;                                            // Number of addr'ing modes found
+//int nmodes;                                          // Number of addr'ing modes found
 int dsp_am0;                                   // Addressing mode
 int dsp_a0reg;                                 // Register
 TOKEN dsp_a0expr[EXPRSIZE];            // Expression
@@ -62,6 +62,9 @@ uint64_t dspaaEXVAL;                  // Expression's value
 WORD  dspaaEXATTR;                             // Expression's attribute
 SYM * dspaaESYM;                               // External symbol involved in expr
 
+LONG dsp_a0perspace;                      // Peripheral space (X, Y - used in movep)
+LONG dsp_a1perspace;                      // Peripheral space (X, Y - used in movep)
+
 int dsp_k;                          // Multiplications sign
 
 static inline LONG checkea(const uint32_t termchar, const int strings);
index 8b78d2dfdee5d923191db360e3be81ab75fff7da..d93f19019e5fd935216e1f57032f9332c13017b9 100644 (file)
@@ -95,41 +95,41 @@ MNTABDSP {
 };
 
 // Addressing mode variables, output of dsp_amode()
-int dsp_am0;                                   // Addressing mode
-int dsp_a0reg;                                 // Register
-int dsp_am1;                                   // Addressing mode
-int dsp_a1reg;                                 // Register
-int dsp_am2;                                   // Addressing mode
-int dsp_a2reg;                                 // Register
-int dsp_am3;                                   // Addressing mode
-int dsp_a3reg;                                 // Register
-
-TOKEN dsp_a0expr[EXPRSIZE];            // Expression
-uint64_t dsp_a0exval;                  // Expression's value
-WORD dsp_a0exattr;                             // Expression's attribute
-SYM * dsp_a0esym;                              // External symbol involved in expr
-LONG dsp_a0memspace;                   // Addressing mode's memory space (P, X, Y)
-LONG dsp_a0perspace;                   // Peripheral space (X, Y - used in movep)
-TOKEN dsp_a1expr[EXPRSIZE];            // Expression
-uint64_t dsp_a1exval;                  // Expression's value
-WORD dsp_a1exattr;                             // Expression's attribute
-SYM * dsp_a1esym;                              // External symbol involved in expr
-LONG dsp_a1memspace;                   // Addressing mode's memory space (P, X, Y)
-LONG dsp_a1perspace;                   // Peripheral space (X, Y - used in movep)
-TOKEN dsp_a2expr[EXPRSIZE];            // Expression
-uint64_t dsp_a2exval;                  // Expression's value
-WORD dsp_a2exattr;                             // Expression's attribute
-SYM * dsp_a2esym;                              // External symbol involved in expr
-TOKEN dsp_a3expr[EXPRSIZE];            // Expression
-uint64_t dsp_a3exval;                  // Expression's value
-WORD dsp_a3exattr;                             // Expression's attribute
-SYM * dsp_a3esym;                              // External symbol involved in expr
-int dsp_k;                                             // Multiplications sign
-TOKEN dspImmedEXPR[EXPRSIZE];  // Expression
-uint64_t dspImmedEXVAL;                        // Expression's value
-WORD  dspImmedEXATTR;                  // Expression's attribute
-SYM * dspImmedESYM;                            // External symbol involved in expr
-int  deposit_extra_ea;                 // Optional effective address extension
+extern int dsp_am0;                                    // Addressing mode
+extern int dsp_a0reg;                                  // Register
+extern int dsp_am1;                                    // Addressing mode
+extern int dsp_a1reg;                                  // Register
+extern int dsp_am2;                                    // Addressing mode
+extern int dsp_a2reg;                                  // Register
+extern int dsp_am3;                                    // Addressing mode
+extern int dsp_a3reg;                                  // Register
+
+extern TOKEN dsp_a0expr[EXPRSIZE];             // Expression
+extern uint64_t dsp_a0exval;                   // Expression's value
+extern WORD dsp_a0exattr;                              // Expression's attribute
+extern SYM * dsp_a0esym;                               // External symbol involved in expr
+extern LONG dsp_a0memspace;                    // Addressing mode's memory space (P, X, Y)
+extern LONG dsp_a0perspace;                    // Peripheral space (X, Y - used in movep)
+extern TOKEN dsp_a1expr[EXPRSIZE];             // Expression
+extern uint64_t dsp_a1exval;                   // Expression's value
+extern WORD dsp_a1exattr;                              // Expression's attribute
+extern SYM * dsp_a1esym;                               // External symbol involved in expr
+extern LONG dsp_a1memspace;                    // Addressing mode's memory space (P, X, Y)
+extern LONG dsp_a1perspace;                    // Peripheral space (X, Y - used in movep)
+extern TOKEN dsp_a2expr[EXPRSIZE];             // Expression
+extern uint64_t dsp_a2exval;                   // Expression's value
+extern WORD dsp_a2exattr;                              // Expression's attribute
+extern SYM * dsp_a2esym;                               // External symbol involved in expr
+extern TOKEN dsp_a3expr[EXPRSIZE];             // Expression
+extern uint64_t dsp_a3exval;                   // Expression's value
+extern WORD dsp_a3exattr;                              // Expression's attribute
+extern SYM * dsp_a3esym;                               // External symbol involved in expr
+extern int dsp_k;                                              // Multiplications sign
+extern TOKEN dspImmedEXPR[EXPRSIZE];   // Expression
+extern uint64_t dspImmedEXVAL;                 // Expression's value
+extern WORD  dspImmedEXATTR;                   // Expression's attribute
+extern SYM * dspImmedESYM;                             // External symbol involved in expr
+extern int deposit_extra_ea;                   // Optional effective address extension
 
 
 // Extra ea deposit modes