#include <winver.h>

#include "config.h"

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)

VS_VERSION_INFO VERSIONINFO
  FILEVERSION PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_MICRO, 0
  PRODUCTVERSION PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_MICRO, 0
  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef DEBUG
  FILEFLAGS VS_FF_DEBUG
#else
  FILEFLAGS 0
#endif
  FILEOS VOS_NT_WINDOWS32 // ok for 64-bit, apparently there's nothing newer
  FILETYPE VFT_DLL
  FILESUBTYPE VFT2_UNKNOWN
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904B0" // US English (0409) and Unicode (04B0)
    BEGIN
      VALUE "CompanyName", PACKAGE_COMPANY
      VALUE "FileDescription", PACKAGE_DESCRIPTION
      VALUE "FileVersion", PACKAGE_VERSION
      VALUE "InternalName", PACKAGE_NAME
      VALUE "LegalCopyright", "©" STR(PACKAGE_YEAR) " " PACKAGE_COMPANY
      VALUE "OriginalFilename", PACKAGE_NAME ".dll"
      VALUE "ProductName", PACKAGE_NAME
      VALUE "ProductVersion", PACKAGE_VERSION
    END
  END
  BLOCK "VarFileInfo"
  BEGIN
    // NB: charset is in decimal here, way to be consitent MS
    VALUE "Translation", 0x0409, 1200 // US English, Unicode
  END
END
