summary refs log tree commit diff stats
path: root/lib/windows/windows.nim
diff options
context:
space:
mode:
authorenurlyx <enurlyx@gmail.com>2014-05-04 12:49:05 +0200
committerenurlyx <enurlyx@gmail.com>2014-05-04 12:49:05 +0200
commita2692f984d93fd1a9bb17e7199f039d116f876bb (patch)
tree7d638b30440a97da5ec118b1d51e07eb755062f2 /lib/windows/windows.nim
parentfa961f16d0d2078a841fccb93231858e2afae94e (diff)
downloadNim-a2692f984d93fd1a9bb17e7199f039d116f876bb.tar.gz
Changed COLORREF from int to DWORD (32 bit long), so that it works also on 64bit Windows
Diffstat (limited to 'lib/windows/windows.nim')
-rw-r--r--lib/windows/windows.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim
index 41f760130..7070833ce 100644
--- a/lib/windows/windows.nim
+++ b/lib/windows/windows.nim
@@ -137,7 +137,7 @@ type  # WinDef.h -- Basic Windows Type Definitions
 

   HFILE* = HANDLE

   HCURSOR* = HANDLE # = HICON

-  COLORREF* = int

+  COLORREF* = DWORD

   LPCOLORREF* = ptr COLORREF

 

   POINT* {.final, pure.} = object

@@ -238,7 +238,7 @@ type
   CALTYPE* = int

   CALID* = int

   CCHAR* = char

-  TCOLORREF* = int

+  TCOLORREF* = COLORREF

   WINT* = int32

   PINTEGER* = ptr int32

   PBOOL* = ptr WINBOOL

@@ -22758,12 +22758,12 @@ proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL =
 

 # WinGDI.h

 

-proc GetGValue*(rgb: int32): int8 =

-  result = toU8(rgb shr 8'i32)

+discard """proc GetGValue*(rgb: int32): int8 =

+  result = toU8(rgb shr 8'i32)"""

 proc RGB*(r, g, b: int): COLORREF =

   result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16)

 proc RGB*(r, g, b: range[0 .. 255]): COLORREF =

-  result = r or g shl 8 or b shl 16

+  result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16)

 

 proc PALETTERGB*(r, g, b: range[0..255]): COLORREF =

   result = 0x02000000 or RGB(r, g, b)