From patchwork Tue May 21 19:16:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 2598821 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0065F40077 for ; Tue, 21 May 2013 19:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883Ab3EUT2L (ORCPT ); Tue, 21 May 2013 15:28:11 -0400 Received: from mdfmta005.mxout.tbr.inty.net ([91.221.168.46]:33939 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752054Ab3EUT2L (ORCPT ); Tue, 21 May 2013 15:28:11 -0400 X-Greylist: delayed 392 seconds by postgrey-1.27 at vger.kernel.org; Tue, 21 May 2013 15:28:10 EDT Received: from mdfmta005.tbr.inty.net (unknown [127.0.0.1]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP id 330ABA64703; Tue, 21 May 2013 20:21:42 +0100 (BST) Received: from mdfmta005.tbr.inty.net (unknown [127.0.0.1]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP id 9B687A646C3; Tue, 21 May 2013 20:21:41 +0100 (BST) Received: from [193.237.126.196] (unknown [193.237.126.196]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP; Tue, 21 May 2013 20:21:41 +0100 (BST) Message-ID: <519BC816.3000304@ramsay1.demon.co.uk> Date: Tue, 21 May 2013 20:16:38 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 2/5] Add support for the MinGW platform X-MDF-HostID: 8 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Signed-off-by: Ramsay Jones --- cgcc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cgcc b/cgcc index c075e5f..e94a965 100755 --- a/cgcc +++ b/cgcc @@ -226,6 +226,19 @@ sub add_specs { ' -D__OpenBSD__=1'; } elsif ($spec eq 'unix') { return ' -Dunix=1 -D__unix=1 -D__unix__=1'; + } elsif ($spec =~ /^mingw/) { + return ' -isystem /mingw/include' . + ' -D__MINGW32__=1' . + ' -D__MSVCRT__=1' . + ' -DWIN32=1 -D_WIN32=1 -D__WIN32=1 -D__WIN32__=1' . + ' -DWINNT=1 -D__WINNT=1 -D__WINNT__=1' . + " -D'_cdecl=__attribute__((__cdecl__))'" . + " -D'__cdecl=__attribute__((__cdecl__))'" . + " -D'_stdcall=__attribute__((__stdcall__))'" . + " -D'__stdcall=__attribute__((__stdcall__))'" . + " -D'_fastcall=__attribute__((__fastcall__))'" . + " -D'__fastcall=__attribute__((__fastcall__))'" . + " -D'__declspec(x)=__attribute__((x))'"; } elsif ( $spec =~ /^cygwin/) { return &add_specs ('unix') . ' -D__CYGWIN__=1 -D__CYGWIN32__=1' .