KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_curl.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015 Mark Roszko <[email protected]>
5 * Copyright (C) 2015, 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24#ifndef KICAD_CURL_H_
25#define KICAD_CURL_H_
26
27/*
28 * KICAD_CURL.h must be included before wxWidgets because on Windows,
29 * wxWidgets ends up including windows.h before winsocks2.h inside curl
30 * this causes build warnings
31 * Because we are before wx, we must explicitly define we are building with unicode.
32 * wxWidgets defaults to supporting unicode now, so this should be safe.
33 */
34#if defined(_WIN32)
35 #ifndef UNICODE
36 # define UNICODE
37 #endif
38
39 #ifndef _UNICODE
40 # define _UNICODE
41 #endif
42#endif
43
44#include <kicommon.h>
45#include <curl/curl.h>
46#include <string>
47
48// CURL_EXTERN expands to dllimport on MinGW which causes gcc warnings. This really should
49// expand to nothing on MinGW.
50#if defined( __MINGW32__)
51# if defined( CURL_EXTERN )
52# undef CURL_EXTERN
53# define CURL_EXTERN
54# endif
55#endif
56
61{
62public:
70 static void Init();
71
76 static void Cleanup();
77
84 static const char* GetVersion()
85 {
86 return curl_version();
87 }
88};
89
90#endif // KICAD_CURL_H_
Simple wrapper class to call curl_global_init and curl_global_cleanup for KiCad.
Definition: kicad_curl.h:61
static const char * GetVersion()
Wrapper for curl_version().
Definition: kicad_curl.h:84
#define KICOMMON_API
Definition: kicommon.h:28