/* A D-specific workaround. */

module allegro.internal._export;

import allegro.internal.dversion;
import allegro.platform.dcommon;


// Support STATICLINK for backwards compatibility.
version (STATICLINK)
   version = STATICALLEGRO;


/*
 * Workaround for the 'export' problem.  I couldn't figure out how to solve it
 * using a .def file, since the IMPORTS directive doesn't seem to work for
 * variables.
 *
 * NB! Putting this in dintern.d creates an import conflict, because dintern
 * imports system.d.
 */
version (Windows) {
   version (STATICALLEGRO) {
      private const ADD_EXPORT = false;

      version (DigitalMars)
         static assert(ALLEGRO_NO_ASM, "For linking with a DMC-created library,"
                              "you need to build with -version=ALLEGRO_NO_ASM");
   }
   else {
      private const ADD_EXPORT = true;
   }
}
else {
   private const ADD_EXPORT = false;
}

template _export(string def)
{
   static if (ADD_EXPORT)
      const string _export = "export " ~ def;
   else
      const string _export = def;
}
