зеркало из https://github.com/mozilla/gecko-dev.git
Родитель
58faec7ad1
Коммит
ad951aa92d
|
@ -113,11 +113,23 @@ PR_PUBLIC_API(nsresult) XPI_Init(
|
|||
|
||||
#elif defined(XP_PC)
|
||||
|
||||
#ifdef XP_OS2_EMX
|
||||
char componentPath[MAX_PATH];
|
||||
_getcwd2(componentPath, MAX_PATH);
|
||||
int len = strlen(componentPath);
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (componentPath[i] == '/') {
|
||||
componentPath[i] = '\\';
|
||||
}
|
||||
}
|
||||
#else
|
||||
char componentPath[MAX_PATH];
|
||||
getcwd(componentPath, MAX_PATH);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsILocalFile> file;
|
||||
NS_NewNativeLocalFile(nsDependentCString(componentPath), PR_TRUE, getter_AddRefs(file));
|
||||
rv = NS_NewNativeLocalFile(nsDependentCString(componentPath), PR_TRUE, getter_AddRefs(file));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = NS_InitXPCOM2(&gServiceMgr, file, nsnull);
|
||||
|
||||
|
|
|
@ -45,18 +45,22 @@
|
|||
send(_socket, (char *) _buf, _len, 0);
|
||||
#include <winsock2.h>
|
||||
#elif defined(__OS2__)
|
||||
#define BSD_SELECT
|
||||
#include <types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#define read(_socket, _buf, _len) \
|
||||
recv(_socket, (char *) _buf, _len, 0);
|
||||
#define write(_socket, _buf, _len) \
|
||||
send(_socket, (char *) _buf, _len, 0);
|
||||
#define close(_socket) \
|
||||
soclose(_socket);
|
||||
#define BSD_SELECT
|
||||
#ifdef XP_OS2_EMX
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <types.h>
|
||||
#define read(_socket, _buf, _len) \
|
||||
recv(_socket, (char *) _buf, _len, 0);
|
||||
#define write(_socket, _buf, _len) \
|
||||
send(_socket, (char *) _buf, _len, 0);
|
||||
#define close(_socket) \
|
||||
soclose(_socket);
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include "nsSocket.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче