• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Go で書き直した Ikemen


Commit MetaInfo

Revision8812e010f19cd943af4fddc728286258dcd761ac (tree)
Zeit2019-01-07 19:49:08
Autorsuehiro <supersuehiro@user...>
Commitersuehiro

Log Message

GOOS=windows でビルドできなかったのを修正

Ändern Zusammenfassung

Diff

--- a/src/stdout_windows.go
+++ b/src/stdout_windows.go
@@ -2,16 +2,19 @@
22 package main
33
44 import (
5- "syscal"
5+ "os"
6+ "syscall"
67 )
78
8-modkernel32 := syscall.NewLazyDLL("kernel32.dll")
9-procAllocConsole := modkernel32.NewProc("AllocConsole")
10-sscall.Syscall(procAllocConsole.Addr(), 0, 0, 0, 0)
11-hout, err1 := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)
12-hin, err2 := syscall.GetStdHandle(syscall.STD_INPUT_HANDLE)
13-if err1 != nil || err2 != nil { // nowhere to print the message
14- s.Exit(2)
9+func init() {
10+ modkernel32 := syscall.NewLazyDLL("kernel32.dll")
11+ procAllocConsole := modkernel32.NewProc("AllocConsole")
12+ syscall.Syscall(procAllocConsole.Addr(), 0, 0, 0, 0)
13+ hout, err1 := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)
14+ hin, err2 := syscall.GetStdHandle(syscall.STD_INPUT_HANDLE)
15+ if err1 != nil || err2 != nil { // nowhere to print the message
16+ syscall.Exit(2)
17+ }
18+ os.Stdout = os.NewFile(uintptr(hout), "/dev/stdout")
19+ os.Stdin = os.NewFile(uintptr(hin), "/dev/stdin")
1520 }
16-os.Stdout = os.NewFile(uintptr(hout), "/dev/stdout")
17-os.Stdin = os.NewFile(uintptr(hin), "/dev/stdin")