source: filezilla/trunk/fuentes/src/include/misc.h @ 3185

Last change on this file since 3185 was 3185, checked in by jrpelegrina, 2 years ago

Update new version: 3.15.02

File size: 1.2 KB
Line 
1#ifndef __MISC_H__
2#define __MISC_H__
3
4#include "socket.h"
5
6// Strongly typed enum would be nice, but we need to support older compilers still.
7namespace dependency {
8enum type {
9        wxwidgets,
10        gnutls,
11        sqlite,
12        count
13};
14}
15
16wxString GetDependencyName( dependency::type d );
17wxString GetDependencyVersion( dependency::type d );
18
19wxString ListTlsCiphers(const wxString& priority);
20
21// Microsoft, in its insane stupidity, has decided to make GetVersion(Ex) useless, starting with Windows 8.1,
22// this function no longer returns the operating system version but instead some arbitrary and random value depending
23// on the phase of the moon.
24// This function instead returns the actual Windows version. On non-Windows systems, it's equivalent to
25// wxGetOsVersion
26bool GetRealOsVersion( int& major, int& minor );
27
28template<typename Derived, typename Base>
29std::unique_ptr<Derived>
30unique_static_cast(std::unique_ptr<Base>&& p)
31{
32        auto d = static_cast<Derived *>(p.release());
33        return std::unique_ptr<Derived>(d);
34}
35
36// wxGetTranslation does not support 64bit ints on 32bit systems.
37#define wxPLURAL_LL(sing, plur, n) \
38        wxGetTranslation((sing), (plur), (sizeof(unsigned int) < 8 && (n) > 1000000000) ? (1000000000 + (n) % 1000000000) : (n))
39
40#endif //__MISC_H__
Note: See TracBrowser for help on using the repository browser.