minio-cpp icon indicating copy to clipboard operation
minio-cpp copied to clipboard

Build failure on macos

Open star-hengxing opened this issue 1 year ago • 0 comments

https://github.com/xmake-io/xmake-repo/actions/runs/10529071455/job/29176023384

/Users/runner/.xmake/cache/packages/2408/m/minio-cpp/v0.3.0/source/src/utils.cc:106:19: error: use of undeclared identifier 'getuid'
  return getpwuid(getuid())->pw_dir;

I make a patch, it work fine on ci.

diff --git a/src/utils.cc b/src/utils.cc
index 05cb8e2..6f16a66 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -24,6 +24,10 @@
 #include <corecrt.h>
 #endif
 
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+
 #include <openssl/bio.h>
 #include <openssl/buffer.h>
 #include <openssl/crypto.h>

star-hengxing avatar Aug 23 '24 17:08 star-hengxing