fix build error on OSX
- fix typo in embedded_data.cpp
Esse commit está contido em:
@@ -18,6 +18,10 @@
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
namespace HPHP {
|
||||
|
||||
std::string current_executable_path() {
|
||||
@@ -29,7 +33,7 @@ std::string current_executable_path() {
|
||||
char result[PATH_MAX];
|
||||
uint32_t size = sizeof(result);
|
||||
uint32_t success = _NSGetExecutablePath(result, &size);
|
||||
return std:string(result, (success == 0) ? size : 0);
|
||||
return std::string(result, (success == 0) ? size : 0);
|
||||
#else
|
||||
// Return empty string for all other platforms for now (e.g. FreeBSD)
|
||||
return std::string();
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#include <mach-o/getsect.h>
|
||||
#endif
|
||||
|
||||
@@ -78,7 +77,7 @@ bool get_embedded_data(const char *section, embedded_data* desc) {
|
||||
#else // __APPLE__
|
||||
const struct section_64 *sect = getsectbyname("__text", section);
|
||||
if (sect) {
|
||||
string path = current_executable();
|
||||
std::string path = current_executable_path();
|
||||
if (!path.empty()) {
|
||||
desc->m_filename = path;
|
||||
} else {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário