#840: Generously adds Fl::args_to_utf8() for MinGW support.

This commit is contained in:
Matthias Melcher 2023-12-15 13:04:57 +01:00
parent fdf578d936
commit 04a5098a58
8 changed files with 8 additions and 0 deletions

View File

@ -676,6 +676,7 @@ int main(int argc,char **argv) {
check_write_permissions(g_system_write_ok, g_user_write_ok);
int i = 1;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
int args_processed = Fl::args(argc, argv, i, read_command_line_args);
if (args_processed < argc) {
fprintf(stderr, "ERROR: Unrecognized command line option \"%s\".\n", argv[i]);

View File

@ -2171,6 +2171,7 @@ int main(int argc,char **argv) {
setlocale(LC_NUMERIC, "C"); // make sure numeric values are written correctly
g_launch_path = end_with_slash(fl_getcwd()); // store the current path at launch
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if ( (Fl::args(argc,argv,i,arg) == 0) // unsupported argument found
|| (batch_mode && (i != argc-1)) // .fl filename missing
|| (!batch_mode && (i < argc-1)) // more than one filename found

View File

@ -160,6 +160,7 @@ void wtype_cb(Fl_Widget *, void *) {
int main(int argc, char **argv) {
int i;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if (!Fl::args(argc, argv, i)) Fl::fatal(Fl::help);
const char *fname = (i < argc) ? argv[i] : "browser.cxx";
Fl_Double_Window window(720, 520, fname);

View File

@ -56,6 +56,7 @@ static RGBdb rgbdb[MAX_RGB];
int main(int argc, char *argv[]) {
int i;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if (!Fl::args(argc, argv, i)) Fl::fatal(Fl::help);
const char *dbname = (i < argc) ? argv[i] : "rgb.txt";

View File

@ -601,6 +601,7 @@ int main(int argc, char **argv) {
// parse commandline
int i = 0;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if (!Fl::args(argc, argv, i) || i < argc-1)
Fl::fatal("Usage: %s <switches> <menufile>\n%s", argv[0], Fl::help);
if (i < argc) {

View File

@ -333,6 +333,7 @@ void create_the_forms() {
int main(int argc, char **argv) {
Fl::scheme(NULL);
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
Fl::args(argc, argv);
Fl::get_system_colors();
create_the_forms();

View File

@ -47,6 +47,7 @@ main(int argc, // I - Number of command-line arguments
Fl_GIF_Image::animate = true; // create animated shared .GIF images
Fl_Help_Dialog *help = new Fl_Help_Dialog;
int i;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if (!Fl::args(argc, argv, i)) Fl::fatal(Fl::help);
const char *fname = (i < argc) ? argv[i] : "help_dialog.html";

View File

@ -421,6 +421,7 @@ static int arg(int argc, char** argv, int& i) {
// registered tests to the browser widget.
int main(int argc, char** argv) {
int i;
Fl::args_to_utf8(argc, argv); // for MSYS2/MinGW
if ( Fl::args(argc,argv,i,arg) == 0 ) { // unsupported argument found
static const char *msg =
"usage: %s <switches>\n"