/********************************************************************/
/*                                                                  */
/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
/*            L   I Q  Q U U I D D   W   W A A R R   5              */
/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
/*                                                                  */
/*                             b                                    */
/*                             bb  y y                              */
/*                             b b yyy                              */
/*                             bb    y                              */
/*                                 yy                               */
/*                                                                  */
/*                     U U       FFF  O   O  TTT                    */
/*                     U U       F   O O O O  T                     */
/*                     U U TIRET FF  O O O O  T                     */
/*                     U U       F   O O O O  T                     */
/*                      U        F    O   O   T                     */
/*                                                                  */
/********************************************************************/

/*****************************************************************************/
/* Liquid War is a multiplayer wargame                                       */
/* Copyright (C) 1998-2025 Christian Mauduit                                 */
/*                                                                           */
/* This program is free software; you can redistribute it and/or modify      */
/* it under the terms of the GNU General Public License as published by      */
/* the Free Software Foundation; either version 2 of the License, or         */
/* (at your option) any later version.                                       */
/*                                                                           */
/* This program is distributed in the hope that it will be useful,           */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
/* GNU General Public License for more details.                              */
/*                                                                           */
/* You should have received a copy of the GNU General Public License         */
/* along with this program; if not, write to the Free Software               */
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
/*                                                                           */
/* Liquid War homepage : https://ufoot.org/liquidwar/v5                   */
/* Contact author      : ufoot@ufoot.org                                     */
/*****************************************************************************/

/********************************************************************/
/* nom           : vbeafex.c                                        */
/* contenu       : workaround for Allegro VBE/AF saved_ds symbol    */
/********************************************************************/

/*
 * This file exists solely to work around a linking issue when building
 * for DOS with DJGPP cross-compiler and modern GCC versions.
 *
 * PROBLEM:
 * Allegro 4.2.3.1's src/misc/vbeafex.c declares:
 *   static unsigned short saved_ds = 0;
 * and then references it from inline assembly as "_saved_ds".
 *
 * With modern GCC (>= 5.0), the "static" keyword prevents the symbol
 * from being exported in a way that inline assembly can reference it,
 * even with -fgnu89-inline. This causes:
 *   undefined reference to `saved_ds'
 *
 * SOLUTION:
 * We provide our own non-static definition of saved_ds here, which will
 * be linked into the final executable and satisfy the reference from
 * Allegro's inline assembly in vbeafex.c (via vbeafs.s).
 *
 * This file is ONLY compiled for DOS builds (Makefile.dj) and is not
 * used by Linux, Windows, or macOS builds.
 */

/* Provide the saved_ds symbol that Allegro's VBE/AF code needs */
unsigned short saved_ds = 0;
