1515
1616#include " StateManager.h"
1717
18- #ifdef __APPLE__
19- // Logging for CoreFoundation
20- #include < CoreFoundation/CoreFoundation.h>
21-
22- extern " C" void NSLog (CFStringRef format, ...);
23- const int32_t BUFFER_SIZE = 256 ;
24-
25- // Wrap macro in do/while to ensure ;
26- #define LOGI (...) do { \
27- char c[BUFFER_SIZE ]; \
28- snprintf (c, BUFFER_SIZE , __VA_ARGS__); \
29- CFStringRef str = CFStringCreateWithCString (kCFAllocatorDefault , c, \
30- kCFStringEncodingMacRoman ); \
31- NSLog (str); \
32- CFRelease (str); \
33- } while (false )
34-
35- #else
36-
3718#include " android/log.h"
3819#define DEBUG_TAG " Minimalist"
3920#define LOGI (...) \
4021 ((void )__android_log_print(ANDROID_LOG_INFO , DEBUG_TAG , __VA_ARGS__))
4122
42- #endif
43-
4423#include " gpg/achievement_manager.h"
4524bool StateManager::is_auth_in_progress_ = false ;
4625std::unique_ptr<gpg::GameServices> StateManager::game_services_;
@@ -117,7 +96,7 @@ void StateManager::InitServices(
11796 if (!game_services_) {
11897 LOGI (" Uninitialized services, so creating" );
11998 game_services_ = gpg::GameServices::Builder ()
120- .SetLogging (gpg::DEFAULT_ON_LOG , gpg::LogLevel::VERBOSE )
99+ .SetOnLog (gpg::DEFAULT_ON_LOG , gpg::LogLevel::VERBOSE )
121100 .SetOnAuthActionStarted ([started_callback](gpg::AuthOperation op) {
122101 is_auth_in_progress_ = true ;
123102 if (started_callback != nullptr )
@@ -138,8 +117,10 @@ void StateManager::InitServices(
138117 LOGI (" --------------------------------------------------------------" );
139118
140119 LOGI (" Fetching all nonblocking" );
141- game_services_->Achievements ().FetchAll (gpg::DataSource::CACHE_OR_NETWORK , [] (gpg::AchievementManager::FetchAllResponse response) {LOGI (" Achievement response status: %d" , response.status );});
142- LOGI (" --------------------------------------------------------------" );
120+ game_services_->Achievements ().FetchAll (gpg::DataSource::CACHE_OR_NETWORK ,
121+ [] (gpg::AchievementManager::FetchAllResponse response) {
122+ LOGI (" Achievement response status: %d" , response.status );});
123+ LOGI (" --------------------------------------------------------------" );
143124
144125 })
145126 .Create (pc);
0 commit comments