* few 64 Bit related fixes, the type change of chtype resolves #27024

git-svn-id: trunk@30280 -
This commit is contained in:
florian 2015-03-22 20:15:59 +00:00
parent 076e43f799
commit 2fdc4f06de

View File

@ -35,6 +35,9 @@
unit ncurses; unit ncurses;
interface interface
uses
unixtype;
{$PACKRECORDS C} {$PACKRECORDS C}
{$LINKLIB ncursesw} {$LINKLIB ncursesw}
{$LINKLIB c} // should be uses initc ? {$LINKLIB c} // should be uses initc ?
@ -52,10 +55,6 @@ type
Bool = Byte; Bool = Byte;
{$ENDIF USE_FPC_BYTEBOOL} {$ENDIF USE_FPC_BYTEBOOL}
type
wchar_t = Widechar;
pwchar_t = ^wchar_t;
const const
{$IFDEF USE_FPC_BYTEBOOL} {$IFDEF USE_FPC_BYTEBOOL}
NC_FPC_TRUE = true; NC_FPC_TRUE = true;
@ -74,18 +73,18 @@ const
type type
pchtype = ^chtype; pchtype = ^chtype;
chtype = Longint; {longword} chtype = culong;
pmmask_t = ^mmask_t; pmmask_t = ^mmask_t;
mmask_t = Longint; {longword} mmask_t = culong;
{ colors } { colors }
var var
{$IFNDEF darwin} {$IFNDEF darwin}
COLORS : Longint cvar; external; COLORS : cint cvar; external;
COLOR_PAIRS : Longint cvar; external; COLOR_PAIRS : cint cvar; external;
{$ELSE darwin} {$ELSE darwin}
COLORS : Longint external libncurses name 'COLORS'; COLORS : cint external libncurses name 'COLORS';
COLOR_PAIRS : Longint external libncurses name 'COLOR_PAIRS'; COLOR_PAIRS : cint external libncurses name 'COLOR_PAIRS';
{$ENDIF darwin} {$ENDIF darwin}
const const
@ -205,7 +204,7 @@ type
attr : attr_t; attr : attr_t;
chars : array[0..CCHARW_MAX - 1] of wchar_t; chars : array[0..CCHARW_MAX - 1] of wchar_t;
{$IFDEF NCURSES_EXT_COLORS} {$IFDEF NCURSES_EXT_COLORS}
ext_color : Longint; { color pair, must be more than 16-bits } ext_color : cint; { color pair, must be more than 16-bits }
{$ENDIF NCURSES_EXT_COLORS} {$ENDIF NCURSES_EXT_COLORS}
end; end;
@ -237,14 +236,14 @@ type
_immed : Bool; { window in immed mode? (not yet used) } _immed : Bool; { window in immed mode? (not yet used) }
_sync : Bool; { window in sync mode? } _sync : Bool; { window in sync mode? }
_use_keypad : Bool; { process function keys into KEY_ symbols? } _use_keypad : Bool; { process function keys into KEY_ symbols? }
_delay : Longint; { 0 = nodelay, <0 = blocking, >0 = delay } _delay : cint; { 0 = nodelay, <0 = blocking, >0 = delay }
_line : ^ldat; { the actual line data } _line : ^ldat; { the actual line data }
{ global screen state } { global screen state }
_regtop : Smallint; { top line of scrolling region } _regtop : Smallint; { top line of scrolling region }
_regbottom : Smallint; { bottom line of scrolling region } _regbottom : Smallint; { bottom line of scrolling region }
{ these are used only if this is a sub-window } { these are used only if this is a sub-window }
_parx : Longint; { x coordinate of this window in parent } _parx : cint; { x coordinate of this window in parent }
_pary : Longint; { y coordinate of this window in parent } _pary : cint; { y coordinate of this window in parent }
_parent : PWINDOW; { pointer to parent if a sub-window } _parent : PWINDOW; { pointer to parent if a sub-window }
{ these are used only if this is a pad } { these are used only if this is a pad }
_pad : record _pad : record
@ -258,7 +257,7 @@ type
_yoffset : Smallint; { real begy is _begy + _yoffset } _yoffset : Smallint; { real begy is _begy + _yoffset }
_bkgrnd : cchar_t; { current background char/attribute pair } _bkgrnd : cchar_t; { current background char/attribute pair }
{$IFDEF NCURSES_EXT_COLORS} {$IFDEF NCURSES_EXT_COLORS}
_color : Longint; { current color-pair for non-space character } _color : cint; { current color-pair for non-space character }
{$ENDIF NCURSES_EXT_COLORS} {$ENDIF NCURSES_EXT_COLORS}
end; end;
@ -558,7 +557,7 @@ const
WA_TOP = A_TOP; WA_TOP = A_TOP;
WA_VERTICAL = A_VERTICAL; WA_VERTICAL = A_VERTICAL;
function COLOR_PAIR(n: longint): longint; inline; function COLOR_PAIR(n: cint): cint; inline;
function PAIR_NUMBER(attr: attr_t): longint; inline; function PAIR_NUMBER(attr: attr_t): longint; inline;
function color_set(color_pair_number: Smallint; opts: Pointer): longint; inline; function color_set(color_pair_number: Smallint; opts: Pointer): longint; inline;