The Battle for Wesnoth  1.19.24+dev
apple_version.mm
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018 - 2025
3  by Martin HrubĂ˝ <hrubymar10@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #ifdef __APPLE__
17 
18 #include "apple_version.hpp"
19 
20 #import "game_version.hpp"
21 
22 #import <Foundation/Foundation.h>
23 
24 #if defined(SDL_PLATFORM_IOS)
25 #import <UIKit/UIKit.h>
26 #endif
27 
28 namespace desktop {
29 namespace apple {
30  std::string os_version() {
31 
32  //
33  // Standard Apple version
34  //
35 
36  std::string version_string;
37 #if defined(SDL_PLATFORM_IOS)
38  version_string = "Apple iOS ";
39 #else
40  if (@available(macOS 10.12, *)) {
41  version_string = "Apple macOS ";
42  } else {
43  version_string = "Apple OS X ";
44  }
45 #endif
46  NSOperatingSystemVersion os_ver = [[NSProcessInfo processInfo] operatingSystemVersion];
47  version_string += version_info(os_ver.majorVersion, os_ver.minorVersion, os_ver.patchVersion);
48 
49  return version_string;
50  }
51 
52 } // end namespace apple
53 } // end namespace desktop
54 
55 #endif //end __APPLE__
Represents version numbers.
Interfaces for manipulating version numbers of engine, add-ons, etc.
std::string os_version()