winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
965 discussions
Start a n
N
ew thread
Nikolay Sivov : gdiplus: Implemented GdipGetRegionBounds/ GdipGetRegionBoundsI.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: dc3908a351875c5c7ff7ee69684eef56a317d128 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc3908a351875c5c7ff7ee696…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Fri Jan 30 23:56:01 2009 +0300 gdiplus: Implemented GdipGetRegionBounds/GdipGetRegionBoundsI. --- dlls/gdiplus/region.c | 56 ++++++++++++++++++++++++++++++++++++--- dlls/gdiplus/tests/region.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index cc3b6cb..e42c5cd 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -634,18 +634,66 @@ GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region) return Ok; } +/***************************************************************************** + * GdipGetRegionBounds [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, GpRectF *rect) { - FIXME("(%p, %p, %p): stub\n", region, graphics, rect); + HRGN hrgn; + RECT r; + GpStatus status; - return NotImplemented; + TRACE("(%p, %p, %p)\n", region, graphics, rect); + + if(!region || !graphics || !rect) + return InvalidParameter; + + status = GdipGetRegionHRgn(region, graphics, &hrgn); + if(status != Ok) + return status; + + /* infinite */ + if(!hrgn){ + rect->X = rect->Y = -(REAL)(1 << 22); + rect->Width = rect->Height = (REAL)(1 << 23); + return Ok; + } + + if(!GetRgnBox(hrgn, &r)){ + DeleteObject(hrgn); + return GenericError; + } + + rect->X = r.left; + rect->Y = r.top; + rect->Width = r.right - r.left; + rect->Height = r.bottom - r.top; + + return Ok; } +/***************************************************************************** + * GdipGetRegionBoundsI [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipGetRegionBoundsI(GpRegion *region, GpGraphics *graphics, GpRect *rect) { - FIXME("(%p, %p, %p): stub\n", region, graphics, rect); + GpRectF rectf; + GpStatus status; - return NotImplemented; + TRACE("(%p, %p, %p)\n", region, graphics, rect); + + if(!rect) + return InvalidParameter; + + status = GdipGetRegionBounds(region, graphics, &rectf); + if(status == Ok){ + rect->X = roundr(rectf.X); + rect->Y = roundr(rectf.X); + rect->Width = roundr(rectf.Width); + rect->Height = roundr(rectf.Height); + } + + return status; } static inline void write_dword(DWORD* location, INT* offset, const DWORD write) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 294fed7..689811c 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -1120,6 +1120,67 @@ static void test_translate(void) ReleaseDC(0, hdc); } +static void test_getbounds(void) +{ + GpRegion *region; + GpGraphics *graphics; + GpStatus status; + GpRectF rectf; + HDC hdc = GetDC(0); + + status = GdipCreateFromHDC(hdc, &graphics); + ok(status == Ok, "status %08x\n", status); + status = GdipCreateRegion(®ion); + ok(status == Ok, "status %08x\n", status); + + /* NULL */ + status = GdipGetRegionBounds(NULL, NULL, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + status = GdipGetRegionBounds(region, NULL, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + status = GdipGetRegionBounds(region, graphics, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + /* infinite */ + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 100.0; + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + ok(rectf.X == -(REAL)(1 << 22), "Expected X = %.2f, got %.2f\n", -(REAL)(1 << 22), rectf.X); + ok(rectf.Y == -(REAL)(1 << 22), "Expected Y = %.2f, got %.2f\n", -(REAL)(1 << 22), rectf.Y); + ok(rectf.Width == (REAL)(1 << 23), "Expected width = %.2f, got %.2f\n", (REAL)(1 << 23), rectf.Width); + ok(rectf.Height == (REAL)(1 << 23), "Expected height = %.2f, got %.2f\n",(REAL)(1 << 23), rectf.Height); + /* empty */ + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 100.0; + status = GdipSetEmpty(region); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + ok(rectf.X == 0.0, "Expected X = 0.0, got %.2f\n", rectf.X); + ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y); + ok(rectf.Width == 0.0, "Expected width = 0.0, got %.2f\n", rectf.Width); + ok(rectf.Height == 0.0, "Expected height = 0.0, got %.2f\n", rectf.Height); + /* rect */ + rectf.X = 10.0; rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + rectf.X = rectf.Y = 0.0; + rectf.Height = rectf.Width = 0.0; + status = GdipGetRegionBounds(region, graphics, &rectf); + ok(status == Ok, "status %08x\n", status); + ok(rectf.X == 10.0, "Expected X = 0.0, got %.2f\n", rectf.X); + ok(rectf.Y == 0.0, "Expected Y = 0.0, got %.2f\n", rectf.Y); + ok(rectf.Width == 100.0, "Expected width = 0.0, got %.2f\n", rectf.Width); + ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height); + + status = GdipDeleteRegion(region); + ok(status == Ok, "status %08x\n", status); + status = GdipDeleteGraphics(graphics); + ok(status == Ok, "status %08x\n", status); + ReleaseDC(0, hdc); +} + START_TEST(region) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1140,6 +1201,7 @@ START_TEST(region) test_gethrgn(); test_isequal(); test_translate(); + test_getbounds(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipTranslateRegionI.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: cb8f4eb16c27b83de86ed52ac4a88e8005fd71b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb8f4eb16c27b83de86ed52ac…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Fri Jan 30 23:03:17 2009 +0300 gdiplus: Implemented GdipTranslateRegionI. --- dlls/gdiplus/region.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 0fe6782..cc3b6cb 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1139,9 +1139,12 @@ GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy) return Ok; } +/***************************************************************************** + * GdipTranslateRegionI [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy) { - FIXME("(%p, %d, %d): stub\n", region, dx, dy); + TRACE("(%p, %d, %d)\n", region, dx, dy); - return NotImplemented; + return GdipTranslateRegion(region, (REAL)dx, (REAL)dy); }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipTranslateRegion.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: c3462b11014f975530f90109269419de2ca4717e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3462b11014f975530f901092…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Fri Jan 30 23:01:14 2009 +0300 gdiplus: Implemented GdipTranslateRegion. --- dlls/gdiplus/region.c | 39 ++++++++++++++++++++- dlls/gdiplus/tests/region.c | 78 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 6b510b6..0fe6782 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1097,11 +1097,46 @@ GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix) return NotImplemented; } +/* Translates GpRegion elements with specified offsets */ +static void translate_region_element(region_element* element, REAL dx, REAL dy) +{ + INT i; + + switch(element->type) + { + case RegionDataEmptyRect: + case RegionDataInfiniteRect: + return; + case RegionDataRect: + element->elementdata.rect.X += dx; + element->elementdata.rect.Y += dy; + return; + case RegionDataPath: + for(i = 0; i < element->elementdata.pathdata.path->pathdata.Count; i++){ + element->elementdata.pathdata.path->pathdata.Points[i].X += dx; + element->elementdata.pathdata.path->pathdata.Points[i].Y += dy; + } + return; + default: + translate_region_element(element->elementdata.combine.left, dx, dy); + translate_region_element(element->elementdata.combine.right, dx, dy); + return; + } +} + +/***************************************************************************** + * GdipTranslateRegion [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy) { - FIXME("(%p, %f, %f): stub\n", region, dx, dy); + TRACE("(%p, %f, %f)\n", region, dx, dy); - return NotImplemented; + if(!region) + return InvalidParameter; + + translate_region_element(®ion->node, dx, dy); + + return Ok; } GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index b6b03c5..294fed7 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -1043,6 +1043,83 @@ static void test_isequal(void) ReleaseDC(0, hdc); } +static void test_translate(void) +{ + GpRegion *region, *region2; + GpGraphics *graphics; + GpPath *path; + GpRectF rectf; + GpStatus status; + HDC hdc = GetDC(0); + BOOL res; + + status = GdipCreateFromHDC(hdc, &graphics); + ok(status == Ok, "status %08x\n", status); + + status = GdipCreatePath(FillModeAlternate, &path); + ok(status == Ok, "status %08x\n", status); + + status = GdipCreateRegion(®ion); + ok(status == Ok, "status %08x\n", status); + status = GdipCreateRegion(®ion2); + ok(status == Ok, "status %08x\n", status); + + /* NULL */ + status = GdipTranslateRegion(NULL, 0.0, 0.0); + ok(status == InvalidParameter, "status %08x\n", status); + + /* infinite */ + status = GdipTranslateRegion(region, 10.0, 10.0); + ok(status == Ok, "status %08x\n", status); + /* empty */ + status = GdipSetEmpty(region); + ok(status == Ok, "status %08x\n", status); + status = GdipTranslateRegion(region, 10.0, 10.0); + ok(status == Ok, "status %08x\n", status); + /* rect */ + rectf.X = 10.0; rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + rectf.X = 15.0; rectf.Y = -2.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region2, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipTranslateRegion(region, 5.0, -2.0); + ok(status == Ok, "status %08x\n", status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + /* path */ + status = GdipAddPathEllipse(path, 0.0, 10.0, 100.0, 150.0); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionPath(region, path, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipResetPath(path); + ok(status == Ok, "status %08x\n", status); + status = GdipAddPathEllipse(path, 10.0, 21.0, 100.0, 150.0); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionPath(region2, path, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipTranslateRegion(region, 10.0, 11.0); + ok(status == Ok, "status %08x\n", status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + + status = GdipDeleteRegion(region); + ok(status == Ok, "status %08x\n", status); + status = GdipDeleteRegion(region2); + ok(status == Ok, "status %08x\n", status); + status = GdipDeleteGraphics(graphics); + ok(status == Ok, "status %08x\n", status); + status = GdipDeletePath(path); + ok(status == Ok, "status %08x\n", status); + ReleaseDC(0, hdc); +} + START_TEST(region) { struct GdiplusStartupInput gdiplusStartupInput; @@ -1062,6 +1139,7 @@ START_TEST(region) test_fromhrgn(); test_gethrgn(); test_isequal(); + test_translate(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Nikolay Sivov : gdiplus: Implemented GdipIsEqualRegion.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: 03a02d83dd4dc4f84bcfaebf8457b341fa56c010 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03a02d83dd4dc4f84bcfaebf8…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Fri Jan 30 22:19:22 2009 +0300 gdiplus: Implemented GdipIsEqualRegion. --- dlls/gdiplus/region.c | 31 +++++++++++++- dlls/gdiplus/tests/region.c | 93 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index e4cc7d8..6b510b6 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1006,12 +1006,39 @@ GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BO return Ok; } +/***************************************************************************** + * GdipIsEqualRegion [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *region, GpRegion *region2, GpGraphics *graphics, BOOL *res) { - FIXME("(%p, %p, %p, %p): stub\n", region, region2, graphics, res); + HRGN hrgn1, hrgn2; + GpStatus stat; - return NotImplemented; + TRACE("(%p, %p, %p, %p)\n", region, region2, graphics, res); + + if(!region || !region2 || !graphics || !res) + return InvalidParameter; + + stat = GdipGetRegionHRgn(region, graphics, &hrgn1); + if(stat != Ok) + return stat; + stat = GdipGetRegionHRgn(region2, graphics, &hrgn2); + if(stat != Ok){ + DeleteObject(hrgn1); + return stat; + } + + *res = EqualRgn(hrgn1, hrgn2); + + /* one of GpRegions is infinite */ + if(*res == ERROR) + *res = (!hrgn1 && !hrgn2); + + DeleteObject(hrgn1); + DeleteObject(hrgn2); + + return Ok; } /***************************************************************************** diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 784b1b9..b6b03c5 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -951,6 +951,98 @@ static void test_gethrgn(void) ReleaseDC(0, hdc); } +static void test_isequal(void) +{ + GpRegion *region1, *region2; + GpGraphics *graphics; + GpRectF rectf; + GpStatus status; + HDC hdc = GetDC(0); + BOOL res; + + status = GdipCreateFromHDC(hdc, &graphics); + ok(status == Ok, "status %08x\n", status); + + status = GdipCreateRegion(®ion1); + ok(status == Ok, "status %08x\n", status); + status = GdipCreateRegion(®ion2); + ok(status == Ok, "status %08x\n", status); + + /* NULL */ + status = GdipIsEqualRegion(NULL, NULL, NULL, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + status = GdipIsEqualRegion(region1, region2, NULL, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + status = GdipIsEqualRegion(region1, region2, graphics, NULL); + ok(status == InvalidParameter, "status %08x\n", status); + status = GdipIsEqualRegion(region1, region2, NULL, &res); + ok(status == InvalidParameter, "status %08x\n", status); + + /* infinite regions */ + res = FALSE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + /* empty regions */ + status = GdipSetEmpty(region1); + ok(status == Ok, "status %08x\n", status); + status = GdipSetEmpty(region2); + ok(status == Ok, "status %08x\n", status); + res = FALSE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + /* empty & infinite */ + status = GdipSetInfinite(region1); + ok(status == Ok, "status %08x\n", status); + res = TRUE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(!res, "Expected to be unequal.\n"); + /* rect & (inf/empty) */ + rectf.X = rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region1, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + res = TRUE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(!res, "Expected to be unequal.\n"); + status = GdipSetInfinite(region2); + ok(status == Ok, "status %08x\n", status); + res = TRUE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(!res, "Expected to be unequal.\n"); + /* roughly equal rectangles */ + rectf.X = rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.001; + status = GdipCombineRegionRect(region2, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + res = FALSE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + /* equal rectangles */ + rectf.X = rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region2, &rectf, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + res = FALSE; + status = GdipIsEqualRegion(region1, region2, graphics, &res); + ok(status == Ok, "status %08x\n", status); + ok(res, "Expected to be equal.\n"); + + /* cleanup */ + status = GdipDeleteRegion(region1); + ok(status == Ok, "status %08x\n", status); + status = GdipDeleteRegion(region2); + ok(status == Ok, "status %08x\n", status); + status = GdipDeleteGraphics(graphics); + ok(status == Ok, "status %08x\n", status); + ReleaseDC(0, hdc); +} + START_TEST(region) { struct GdiplusStartupInput gdiplusStartupInput; @@ -969,6 +1061,7 @@ START_TEST(region) test_combinereplace(); test_fromhrgn(); test_gethrgn(); + test_isequal(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Austin English : configure.ac: Check for icps_outhist struct.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: ac0252db3323d9827e2d63ed355cfc398160f15f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac0252db3323d9827e2d63ed3…
Author: Austin English <austinenglish(a)gmail.com> Date: Fri Jan 30 10:18:10 2009 -0600 configure.ac: Check for icps_outhist struct. --- configure | 171 +++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 36 ++++++++++ dlls/iphlpapi/ipstats.c | 8 ++- include/config.h.in | 3 + 4 files changed, 216 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 00de501..2363f46 100755 --- a/configure +++ b/configure @@ -23567,6 +23567,177 @@ _ACEOF fi +{ $as_echo "$as_me:$LINENO: checking for struct icmpstat.icps_outhist" >&5 +$as_echo_n "checking for struct icmpstat.icps_outhist... " >&6; } +if test "${ac_cv_member_struct_icmpstat_icps_outhist+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ALIAS_H +#include <alias.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_SYS_TIMEOUT_H +#include <sys/timeout.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include <netinet/in_systm.h> +#endif +#ifdef HAVE_NETINET_IP_H +#include <netinet/ip.h> +#endif +#ifdef HAVE_NETINET_IP_VAR_H +#include <netinet/ip_var.h> +#endif +#ifdef HAVE_NETINET_IP_ICMP_H +#include <netinet/ip_icmp.h> +#endif +#ifdef HAVE_NETINET_ICMP_VAR +#include <netinet/icmp_var.h> +#endif + +int +main () +{ +static struct icmpstat ac_aggr; +if (ac_aggr.icps_outhist) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_icmpstat_icps_outhist=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ALIAS_H +#include <alias.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_SYS_TIMEOUT_H +#include <sys/timeout.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include <netinet/in_systm.h> +#endif +#ifdef HAVE_NETINET_IP_H +#include <netinet/ip.h> +#endif +#ifdef HAVE_NETINET_IP_VAR_H +#include <netinet/ip_var.h> +#endif +#ifdef HAVE_NETINET_IP_ICMP_H +#include <netinet/ip_icmp.h> +#endif +#ifdef HAVE_NETINET_ICMP_VAR +#include <netinet/icmp_var.h> +#endif + +int +main () +{ +static struct icmpstat ac_aggr; +if (sizeof ac_aggr.icps_outhist) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_icmpstat_icps_outhist=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_icmpstat_icps_outhist=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_icmpstat_icps_outhist" >&5 +$as_echo "$ac_cv_member_struct_icmpstat_icps_outhist" >&6; } +if test "x$ac_cv_member_struct_icmpstat_icps_outhist" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST 1 +_ACEOF + + +fi + + { $as_echo "$as_me:$LINENO: checking for timezone variable" >&5 $as_echo_n "checking for timezone variable... " >&6; } if test "${ac_cv_have_timezone+set}" = set; then diff --git a/configure.ac b/configure.ac index fd760bd..3b65eea 100644 --- a/configure.ac +++ b/configure.ac @@ -1730,6 +1730,42 @@ AC_CHECK_MEMBERS([ns_msg._msg_ptr],,, # include <arpa/nameser.h> #endif]) +dnl Check for struct icmpstat.icps_outhist +AC_CHECK_MEMBERS([struct icmpstat.icps_outhist],,, +[#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_ALIAS_H +#include <alias.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_SYS_TIMEOUT_H +#include <sys/timeout.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include <netinet/in_systm.h> +#endif +#ifdef HAVE_NETINET_IP_H +#include <netinet/ip.h> +#endif +#ifdef HAVE_NETINET_IP_VAR_H +#include <netinet/ip_var.h> +#endif +#ifdef HAVE_NETINET_IP_ICMP_H +#include <netinet/ip_icmp.h> +#endif +#ifdef HAVE_NETINET_ICMP_VAR +#include <netinet/icmp_var.h> +#endif]) + dnl Check for the external timezone variables timezone and daylight AC_CACHE_CHECK([for timezone variable], ac_cv_have_timezone, AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[timezone = 1]])],[ac_cv_have_timezone="yes"],[ac_cv_have_timezone="no"])) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 31336f9..b112793 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -323,7 +323,7 @@ DWORD getICMPStats(MIB_ICMP *stats) stats->stats.icmpInStats.dwAddrMasks = icmp_stat.icps_inhist[ICMP_MASKREQ]; stats->stats.icmpInStats.dwAddrMaskReps = icmp_stat.icps_inhist[ICMP_MASKREPLY]; - +#ifdef HAVE_ICPS_OUTHIST /* out stats */ stats->stats.icmpOutStats.dwMsgs = icmp_stat.icps_oldshort + icmp_stat.icps_oldicmp; for(i = 0; i <= ICMP_MAXTYPE; i++) @@ -342,9 +342,13 @@ DWORD getICMPStats(MIB_ICMP *stats) stats->stats.icmpOutStats.dwTimestampReps = icmp_stat.icps_outhist[ICMP_TSTAMPREPLY]; stats->stats.icmpOutStats.dwAddrMasks = icmp_stat.icps_outhist[ICMP_MASKREQ]; stats->stats.icmpOutStats.dwAddrMaskReps = icmp_stat.icps_outhist[ICMP_MASKREPLY]; +#else /* ICPS_OUTHIST */ + memset( &stats->stats.icmpOutStats, 0, sizeof(stats->stats.icmpOutStats) ); +#endif /* ICPS_OUTHIST */ return NO_ERROR; -#else + +#else /* ICMPCTL_STATS */ FILE *fp; if (!stats) diff --git a/include/config.h.in b/include/config.h.in index 21ffe93..f1c4194 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -720,6 +720,9 @@ /* Define to 1 if `direction' is member of `struct ff_effect'. */ #undef HAVE_STRUCT_FF_EFFECT_DIRECTION +/* Define to 1 if `icps_outhist' is member of `struct icmpstat'. */ +#undef HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST + /* Define to 1 if `msg_accrights' is member of `struct msghdr'. */ #undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
1
0
0
0
Vitaliy Margolen : dinput: Consume mouse & keyboard events in exclusive mode.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: 3743a1a7ca170c765cd779c61b9e362c5b1c5203 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3743a1a7ca170c765cd779c61…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Feb 1 13:11:46 2009 -0700 dinput: Consume mouse & keyboard events in exclusive mode. --- dlls/dinput/dinput_main.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 46e4e28..bdcf557 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -885,6 +885,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) { IDirectInputImpl *dinput; + int skip = 0; if (code != HC_ACTION) return CallNextHookEx( 0, code, wparam, lparam ); @@ -899,12 +900,13 @@ static LRESULT CALLBACK LL_hook_proc( int code, WPARAM wparam, LPARAM lparam ) { TRACE("calling %p->%p (%lx %lx)\n", dev, dev->event_proc, wparam, lparam); dev->event_proc( (LPDIRECTINPUTDEVICE8A)dev, wparam, lparam ); + skip |= dev->dwCoopLevel & DISCL_EXCLUSIVE; } LeaveCriticalSection( &dinput->crit ); } LeaveCriticalSection( &dinput_hook_crit ); - return CallNextHookEx( 0, code, wparam, lparam ); + return skip ? 1 : CallNextHookEx( 0, code, wparam, lparam ); } static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam )
1
0
0
0
Alexandre Julliard : configure: Remove no longer needed check for -fshort-wchar.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: f35ddbaf685d9ce7598020c8645dbe12754d4bb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f35ddbaf685d9ce7598020c86…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 2 12:27:56 2009 +0100 configure: Remove no longer needed check for -fshort-wchar. --- configure | 69 +-------------------------------------------------- configure.ac | 4 --- include/config.h.in | 3 -- 3 files changed, 1 insertions(+), 75 deletions(-) diff --git a/configure b/configure index dbe24d4..00de501 100755 --- a/configure +++ b/configure @@ -17224,74 +17224,7 @@ $as_echo "$ac_cv_c_gcc_strength_bug" >&6; } EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce" fi - - { $as_echo "$as_me:$LINENO: checking whether the compiler supports -fshort-wchar" >&5 -$as_echo_n "checking whether the compiler supports -fshort-wchar... " >&6; } -if test "${ac_cv_cflags__fshort_wchar+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -fshort-wchar" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_cflags__fshort_wchar=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cflags__fshort_wchar=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -CFLAGS=$ac_wine_try_cflags_saved -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cflags__fshort_wchar" >&5 -$as_echo "$ac_cv_cflags__fshort_wchar" >&6; } -if test $ac_cv_cflags__fshort_wchar = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CC_FLAG_SHORT_WCHAR "-fshort-wchar" -_ACEOF - -fi - - { $as_echo "$as_me:$LINENO: checking whether the compiler supports -fno-builtin" >&5 + { $as_echo "$as_me:$LINENO: checking whether the compiler supports -fno-builtin" >&5 $as_echo_n "checking whether the compiler supports -fno-builtin... " >&6; } if test "${ac_cv_cflags__fno_builtin+set}" = set; then $as_echo_n "(cached) " >&6 diff --git a/configure.ac b/configure.ac index b0725c1..fd760bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1312,10 +1312,6 @@ then fi dnl Check for some compiler flags - - WINE_TRY_CFLAGS([-fshort-wchar], - [AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", - [Specifies the compiler flag that forces a short wchar_t])]) WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")]) WINE_TRY_CFLAGS([-fno-strict-aliasing]) WINE_TRY_CFLAGS([-Wdeclaration-after-statement]) diff --git a/include/config.h.in b/include/config.h.in index 036b5fb..21ffe93 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -2,9 +2,6 @@ #define __WINE_CONFIG_H -/* Specifies the compiler flag that forces a short wchar_t */ -#undef CC_FLAG_SHORT_WCHAR - /* Define to 1 if you have the <alias.h> header file. */ #undef HAVE_ALIAS_H
1
0
0
0
Alexandre Julliard : winegcc: Support -b option for cross-compiling.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: 34729392551a19d21ea4f0801d2d4c4cf10910fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34729392551a19d21ea4f0801…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 2 12:25:37 2009 +0100 winegcc: Support -b option for cross-compiling. --- tools/winegcc/utils.c | 7 +++ tools/winegcc/utils.h | 1 + tools/winegcc/winegcc.c | 120 +++++++++++++++++++++++++++++++++++++--------- 3 files changed, 104 insertions(+), 24 deletions(-) diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index f30a8c3..743f2e0 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -66,6 +66,13 @@ void *xrealloc(void* p, size_t size) return p2; } +char *xstrdup( const char *str ) +{ + char *res = strdup( str ); + if (!res) error("Virtual memory exhausted.\n"); + return res; +} + int strendswith(const char* str, const char* end) { int l = strlen(str); diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h index 4c8fec3..a48bbf0 100644 --- a/tools/winegcc/utils.h +++ b/tools/winegcc/utils.h @@ -35,6 +35,7 @@ void error(const char* s, ...) DECLSPEC_NORETURN; void* xmalloc(size_t size); void* xrealloc(void* p, size_t size); +char *xstrdup( const char *str ); char* strmake(const char* fmt, ...); int strendswith(const char* str, const char* end); diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 5434760..e0b03b1 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -88,6 +88,7 @@ #include "config.h" #include "wine/port.h" +#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <signal.h> @@ -154,11 +155,43 @@ enum target_platform PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_WINDOWS }; -struct options +static const struct +{ + const char *name; + enum target_cpu cpu; +} cpu_names[] = +{ + { "i386", CPU_x86 }, + { "i486", CPU_x86 }, + { "i586", CPU_x86 }, + { "i686", CPU_x86 }, + { "i786", CPU_x86 }, + { "x86_64", CPU_x86_64 }, + { "sparc", CPU_SPARC }, + { "alpha", CPU_ALPHA }, + { "powerpc", CPU_POWERPC } +}; + +static const struct +{ + const char *name; + enum target_platform platform; +} platform_names[] = +{ + { "macos", PLATFORM_APPLE }, + { "darwin", PLATFORM_APPLE }, + { "solaris", PLATFORM_SOLARIS }, + { "mingw32", PLATFORM_WINDOWS }, + { "windows", PLATFORM_WINDOWS }, + { "winnt", PLATFORM_WINDOWS } +}; + +struct options { enum processor processor; enum target_cpu target_cpu; enum target_platform target_platform; + const char *target; int shared; int use_msvcrt; int nostdinc; @@ -248,29 +281,20 @@ static char* get_temp_file(const char* prefix, const char* suffix) return tmp; } -static const strarray* get_translator(enum processor processor) +static const strarray* get_translator(struct options *opts) { - static strarray* cpp = 0; - static strarray* as = 0; - static strarray* cc = 0; - static strarray* cxx = 0; + const char *str; - switch(processor) + switch(opts->processor) { - case proc_cpp: - if (!cpp) cpp = strarray_fromstring(CPP, " "); - return cpp; - case proc_cc: - if (!cc) cc = strarray_fromstring(CC, " "); - return cc; - case proc_cxx: - if (!cxx) cxx = strarray_fromstring(CXX, " "); - return cxx; - case proc_as: - if (!as) as = strarray_fromstring(AS, " "); - return as; + case proc_cpp: str = CPP; break; + case proc_cc: str = CC; break; + case proc_cxx: str = CXX; break; + case proc_as: str = AS; break; + default: assert(0); } - error("Unknown processor\n"); + if (opts->target) str = strmake( "%s-%s", opts->target, str ); + return strarray_fromstring( str, " " ); } static void compile(struct options* opts, const char* lang) @@ -279,7 +303,7 @@ static void compile(struct options* opts, const char* lang) unsigned int j; int gcc_defs = 0; - strarray_addall(comp_args, get_translator(opts->processor)); + strarray_addall(comp_args, get_translator(opts)); switch(opts->processor) { case proc_cpp: gcc_defs = 1; break; @@ -614,6 +638,11 @@ static void build(struct options* opts) strarray_add(spec_args, winebuild); if (verbose) strarray_add(spec_args, "-v"); if (keep_generated) strarray_add(spec_args, "--save-temps"); + if (opts->target) + { + strarray_add(spec_args, "--target"); + strarray_add(spec_args, opts->target); + } strarray_add(spec_args, "--as-cmd"); strarray_add(spec_args, AS); strarray_add(spec_args, "--ld-cmd"); @@ -669,7 +698,7 @@ static void build(struct options* opts) /* link everything together now */ link_args = strarray_alloc(); - strarray_addall(link_args, get_translator(opts->processor)); + strarray_addall(link_args, get_translator(opts)); strarray_addall(link_args, strarray_fromstring(LDDLLFLAGS, " ")); strarray_add(link_args, "-o"); @@ -760,7 +789,7 @@ static void forward(int argc, char **argv, struct options* opts) strarray* args = strarray_alloc(); int j; - strarray_addall(args, get_translator(opts->processor)); + strarray_addall(args, get_translator(opts)); for( j = 1; j < argc; j++ ) strarray_add(args, argv[j]); @@ -843,6 +872,46 @@ static int is_mingw_arg(const char* arg) return 0; } +static void parse_target_option( struct options *opts, const char *target ) +{ + char *p, *platform, *spec = xstrdup( target ); + unsigned int i; + + /* target specification is in the form CPU-MANUFACTURER-OS or CPU-MANUFACTURER-KERNEL-OS */ + + /* get the CPU part */ + + if (!(p = strchr( spec, '-' ))) error( "Invalid target specification '%s'\n", target ); + *p++ = 0; + for (i = 0; i < sizeof(cpu_names)/sizeof(cpu_names[0]); i++) + { + if (!strcmp( cpu_names[i].name, spec )) + { + opts->target_cpu = cpu_names[i].cpu; + break; + } + } + if (i == sizeof(cpu_names)/sizeof(cpu_names[0])) + error( "Unrecognized CPU '%s'\n", spec ); + platform = p; + if ((p = strrchr( p, '-' ))) platform = p + 1; + + /* get the OS part */ + + opts->target_platform = PLATFORM_UNSPECIFIED; /* default value */ + for (i = 0; i < sizeof(platform_names)/sizeof(platform_names[0]); i++) + { + if (!strncmp( platform_names[i].name, platform, strlen(platform_names[i].name) )) + { + opts->target_platform = platform_names[i].platform; + break; + } + } + + free( spec ); + opts->target = xstrdup( target ); +} + int main(int argc, char **argv) { int i, c, next_is_arg = 0, linking = 1; @@ -943,7 +1012,7 @@ int main(int argc, char **argv) raw_linker_arg = 0; if (argv[i][1] == 'c' || argv[i][1] == 'L') raw_compiler_arg = 0; - if (argv[i][1] == 'o') + if (argv[i][1] == 'o' || argv[i][1] == 'b') raw_compiler_arg = raw_linker_arg = 0; /* do a bit of semantic analysis */ @@ -963,6 +1032,9 @@ int main(int argc, char **argv) if (!opts.prefix) opts.prefix = strarray_alloc(); strarray_add(opts.prefix, str); break; + case 'b': + parse_target_option( &opts, option_arg ); + break; case 'c': /* compile or assemble */ if (argv[i][2] == 0) opts.compile_only = 1; /* fall through */
1
0
0
0
Alexandre Julliard : winegcc: Make platform-specific behaviors depend on variables instead of #ifdefs.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: 9e04ecd9de3c001c2420df865bb8cd95b69b95fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e04ecd9de3c001c2420df865…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 2 12:19:11 2009 +0100 winegcc: Make platform-specific behaviors depend on variables instead of #ifdefs. --- tools/winegcc/winegcc.c | 180 +++++++++++++++++++++++++++++------------------ 1 files changed, 112 insertions(+), 68 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9e04ecd9de3c001c2420d…
1
0
0
0
Paul Vriens : kernel32/tests: Fix remaining failures on Win9x and WinME.
by Alexandre Julliard
02 Feb '09
02 Feb '09
Module: wine Branch: master Commit: 047a43f084135a188f7b691f345137e3c2a5ee18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=047a43f084135a188f7b691f3…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Sat Jan 31 15:37:59 2009 +0100 kernel32/tests: Fix remaining failures on Win9x and WinME. --- dlls/kernel32/tests/profile.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index 24342da..2e5678c 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -402,8 +402,11 @@ static void test_profile_delete_on_close(void) "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents - 1, "Test file: partial write\n"); + SetLastError(0xdeadbeef); res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); - ok( res == 123, "Got %d instead of 123\n", res); + ok( res == 123 || + broken(res == 0 && GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x, WinME */ + "Got %d instead of 123\n", res); /* This also deletes the file */ CloseHandle(h); @@ -423,8 +426,11 @@ static void test_profile_refresh(void) "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents1 - 1, "Test file: partial write\n"); + SetLastError(0xdeadbeef); res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); - ok( res == 123, "Got %d instead of 123\n", res); + ok( res == 123 || + broken(res == 0 && GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x, WinME */ + "Got %d instead of 123\n", res); CloseHandle(h); @@ -436,8 +442,11 @@ static void test_profile_refresh(void) "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents2 - 1, "Test file: partial write\n"); + SetLastError(0xdeadbeef); res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); - ok( res == 124, "Got %d instead of 124\n", res); + ok( res == 124 || + broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */ + "Got %d instead of 124\n", res); /* This also deletes the file */ CloseHandle(h);
1
0
0
0
← Newer
1
...
92
93
94
95
96
97
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Results per page:
10
25
50
100
200