Skip to content

Commit 3d14d13

Browse files
committed
Fixed gets_s issue of macOS
1 parent 691f5ff commit 3d14d13

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

framework/areg/base/private/posix/ProcessPosix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
void Process::_osInitilize( void )
3131
{
3232
#ifdef BIT64
33-
constexpr const char _fmtCmdLine[] = "/proc/%lu/cmdline";
34-
constexpr const char _fmtExePath[] = "/proc/%lu/exe";
33+
constexpr const char _fmtCmdLine[] = "/proc/%llu/cmdline";
34+
constexpr const char _fmtExePath[] = "/proc/%llu/exe";
3535
#else // defined(BIT32)
3636
constexpr const char _fmtCmdLine[] = "/proc/%u/cmdline";
3737
constexpr const char _fmtExePath[] = "/proc/%u/exe";

framework/aregextend/console/private/ansi/ConsoleAnsi.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,15 @@ bool Console::_osWaitInputString(char* buffer, uint32_t size) const
164164
if (::fgets(buffer, size, stdin) == nullptr)
165165
return false;
166166
#endif // defined(_WIN32)
167-
#else
167+
#else // !defined(__STDC_WANT_LIB_EXT1__) || !(__STDC_WANT_LIB_EXT1__)
168+
#if POSIX
169+
if (::fgets(buffer, size, stdin) == nullptr)
170+
return false;
171+
#else // !POSIX
168172
if (::gets_s(buffer, size) == nullptr)
169173
return false;
170-
#endif // _WIN32
174+
#endif // POSIX
175+
#endif // !defined(__STDC_WANT_LIB_EXT1__) || !(__STDC_WANT_LIB_EXT1__)
171176

172177
NEString::trimAll<char>(buffer);
173178
return ( NEString::isEmpty(buffer) == false );

0 commit comments

Comments
 (0)