Skip to content
Snippets Groups Projects
Select Git revision
  • 754f4c4f7f23709ffea600a715baf6da11a2ab1c
  • master default protected
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
41 results

build-for-arm.md

Blame
    • Benjamin Gallois's avatar
      eb590e1c
      Fix #200 (!267) · eb590e1c
      Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
      * remove /ws from listen address
      
      * fix error when user already exist
      
      * change binary to duniter2
      
      * add rpc-cors
      
      * add config documentation
      
      * add reference in service files
      
      * use embedded distance oracle
      
      * optimize ci
      
      * use docker cache
      
      * add systemd timer
      
      * add documentation
      
      * fix base_path default
      
      * add duniter user
      
      * add services
      
      * update docs
      
      * add deb package to ci
      
      * add deb docker building
      eb590e1c
      History
      Fix #200 (!267)
      Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
      * remove /ws from listen address
      
      * fix error when user already exist
      
      * change binary to duniter2
      
      * add rpc-cors
      
      * add config documentation
      
      * add reference in service files
      
      * use embedded distance oracle
      
      * optimize ci
      
      * use docker cache
      
      * add systemd timer
      
      * add documentation
      
      * fix base_path default
      
      * add duniter user
      
      * add services
      
      * update docs
      
      * add deb package to ci
      
      * add deb docker building
    utils.cpp 1.61 KiB
    #include "utils.h"
    
    #include <flutter_windows.h>
    #include <io.h>
    #include <stdio.h>
    #include <windows.h>
    
    #include <iostream>
    
    void CreateAndAttachConsole() {
      if (::AllocConsole()) {
        FILE *unused;
        if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
          _dup2(_fileno(stdout), 1);
        }
        if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
          _dup2(_fileno(stdout), 2);
        }
        std::ios::sync_with_stdio();
        FlutterDesktopResyncOutputStreams();
      }
    }
    
    std::vector<std::string> GetCommandLineArguments() {
      // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
      int argc;
      wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
      if (argv == nullptr) {
        return std::vector<std::string>();
      }
    
      std::vector<std::string> command_line_arguments;
    
      // Skip the first argument as it's the binary name.
      for (int i = 1; i < argc; i++) {
        command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
      }
    
      ::LocalFree(argv);
    
      return command_line_arguments;
    }
    
    std::string Utf8FromUtf16(const wchar_t* utf16_string) {
      if (utf16_string == nullptr) {
        return std::string();
      }
      int target_length = ::WideCharToMultiByte(
          CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
          -1, nullptr, 0, nullptr, nullptr);
      if (target_length == 0) {
        return std::string();
      }
      std::string utf8_string;
      utf8_string.resize(target_length);
      int converted_length = ::WideCharToMultiByte(
          CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
          -1, utf8_string.data(),
          target_length, nullptr, nullptr);
      if (converted_length == 0) {
        return std::string();
      }
      return utf8_string;
    }