win32: use _WIN32 macro instead of WIN32

parent e1f34777
......@@ -35,7 +35,7 @@
#include "linphonec.h"
#include "lpconfig.h"
#ifndef WIN32
#ifndef _WIN32
#include <sys/wait.h>
#include <unistd.h>
#endif
......@@ -118,7 +118,7 @@ static void linphonec_friend_display(LinphoneFriend *fr);
static int linphonec_friend_list(LinphoneCore *lc, char *arg);
static void linphonec_display_command_help(LPC_COMMAND *cmd);
static int linphonec_friend_call(LinphoneCore *lc, unsigned int num);
#ifndef WIN32
#ifndef _WIN32
static int linphonec_friend_add(LinphoneCore *lc, const char *name, const char *addr);
#endif
static int linphonec_friend_delete(LinphoneCore *lc, int num);
......@@ -949,7 +949,7 @@ lpc_cmd_firewall(LinphoneCore *lc, char *args)
return 1;
}
#ifndef WIN32
#ifndef _WIN32
/* Helper function for processing freind names */
static int
lpc_friend_name(char **args, char **name)
......@@ -1034,7 +1034,7 @@ lpc_cmd_friend(LinphoneCore *lc, char *args)
}
else if ( !strncmp(args, "add", 3) )
{
#ifndef WIN32
#ifndef _WIN32
char *name;
char addr[80];
char *addr_p = addr;
......@@ -1886,7 +1886,7 @@ linphonec_friend_call(LinphoneCore *lc, unsigned int num)
return 1;
}
#ifndef WIN32
#ifndef _WIN32
static int
linphonec_friend_add(LinphoneCore *lc, const char *name, const char *addr)
{
......@@ -2139,7 +2139,7 @@ static int lpc_cmd_param(LinphoneCore *lc, char *args)
}
static int lpc_cmd_speak(LinphoneCore *lc, char *args){
#ifndef WIN32
#ifndef _WIN32
char voice[64];
char *sentence;
char cl[128];
......
......@@ -38,7 +38,7 @@
#include "linphonec.h"
#ifdef WIN32
#ifdef _WIN32
#include <ws2tcpip.h>
#include <ctype.h>
#ifndef _WIN32_WCE
......@@ -439,7 +439,7 @@ static void start_prompt_reader(void){
#if !defined(_WIN32_WCE)
static ortp_pipe_t create_server_socket(void){
char path[128];
#ifndef WIN32
#ifndef _WIN32
snprintf(path,sizeof(path)-1,"linphonec-%i",getuid());
#else
{
......@@ -459,7 +459,7 @@ static void *pipe_thread(void*p){
if (server_sock==ORTP_PIPE_INVALID) return NULL;
while(pipe_reader_run){
while(client_sock!=ORTP_PIPE_INVALID){ /*sleep until the last command is finished*/
#ifndef WIN32
#ifndef _WIN32
usleep(20000);
#else
Sleep(20);
......@@ -537,7 +537,7 @@ char *linphonec_readline(char *prompt){
}
ms_mutex_unlock(&prompt_mutex);
linphonec_idle_call();
#ifdef WIN32
#ifdef _WIN32
{
MSG msg;
Sleep(20);
......
......@@ -25,7 +25,7 @@
#include <string.h>
#include <assert.h>
#ifdef WIN32
#ifdef _WIN32
#include <ws2tcpip.h>
#include <windows.h>
#include <winbase.h>
......@@ -82,7 +82,7 @@ static int send_command(const char *command, char *reply, int reply_len, int pri
int i;
int err;
char path[128];
#ifndef WIN32
#ifndef _WIN32
snprintf(path,sizeof(path)-1,"linphonec-%i",getuid());
#else
{
......@@ -130,7 +130,7 @@ static void print_usage(void){
exit(-1);
}
#ifdef WIN32
#ifdef _WIN32
static char *argv_to_line(int argc, char *argv[]) {
int i;
int line_length;
......@@ -157,7 +157,7 @@ static char *argv_to_line(int argc, char *argv[]) {
#define MAX_ARGS 10
#ifndef WIN32
#ifndef _WIN32
static void spawn_linphonec(int argc, char *argv[]){
char * args[MAX_ARGS];
int i,j;
......
......@@ -459,7 +459,7 @@ int main(int argc, char *argv[])
while (run_cond){
sipomatic_iterate(&sipomatic);
#ifndef WIN32
#ifndef _WIN32
usleep(20000);
#else
Sleep(20);
......
......@@ -68,7 +68,7 @@ static gchar *get_record_file(void){
time_t curtime=time(NULL);
struct tm loctime;
#ifdef WIN32
#ifdef _WIN32
loctime=*localtime(&curtime);
#else
localtime_r(&curtime,&loctime);
......@@ -296,7 +296,7 @@ void display_popup(GtkMessageType type,const gchar *message){
static void open_mixer(void){
GError *error = NULL;
#ifdef WIN32
#ifdef _WIN32
if(!g_spawn_command_line_async("control mmsys.cpl",&error)){
display_popup(GTK_MESSAGE_WARNING,_("Sound preferences not found "));
g_error_free(error);
......
......@@ -31,7 +31,7 @@ char *linphone_gtk_call_logs_storage_get_db_file(const char *filename){
if (access(CONFIG_FILE,F_OK)==0){
snprintf(db_file,path_max,"%s",filename);
}else{
#ifdef WIN32
#ifdef _WIN32
const char *appdata=getenv("APPDATA");
if (appdata){
snprintf(db_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
......
......@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <gtkosxapplication.h>
#endif
#if defined(WIN32) && !defined(F_OK)
#if defined(_WIN32) && !defined(F_OK)
#define F_OK 00 /*visual studio does not define F_OK*/
#endif
......@@ -65,7 +65,7 @@ char *linphone_gtk_message_storage_get_db_file(const char *filename){
if (access(CONFIG_FILE,F_OK)==0){
snprintf(db_file,path_max,"%s",filename);
}else{
#ifdef WIN32
#ifdef _WIN32
const char *appdata=getenv("APPDATA");
if (appdata){
snprintf(db_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
......
......@@ -996,7 +996,7 @@ char *linphone_gtk_friends_storage_get_db_file(const char *filename){
if (access(CONFIG_FILE,F_OK)==0){
snprintf(db_file,path_max,"%s",filename);
}else{
#ifdef WIN32
#ifdef _WIN32
const char *appdata=getenv("APPDATA");
if (appdata){
snprintf(db_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
......
......@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma GCC diagnostic pop
#endif
#ifdef WIN32
#ifdef _WIN32
// alloca is already defined by gtk
#undef alloca
#endif
......
......@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphone.h"
#ifndef WIN32
#ifndef _WIN32
#include <sys/stat.h>
#include <sys/types.h>
#endif
......@@ -88,7 +88,7 @@ static FILE *linphone_gtk_log_init(void)
/* arrange for _logdir to contain a
directory that has been created and _logfname to contain the
path to a file to which we will log */
#ifdef WIN32
#ifdef _WIN32
const char *appdata=getenv("LOCALAPPDATA");
if (appdata) {
snprintf(_logdir, sizeof(_logdir),"%s\\Linphone", appdata);
......
......@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#endif
......@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <gtkosxapplication.h>
#endif
#ifdef WIN32
#ifdef _WIN32
#define chdir _chdir
#include "direct.h"
#ifndef F_OK
......@@ -148,7 +148,7 @@ static GOptionEntry linphone_options[]={
#define RELATIVE_XML_DIR
#define BUILD_TREE_XML_DIR "gtk"
#ifndef WIN32
#ifndef _WIN32
#define CONFIG_FILE ".linphonerc"
#define SECRETS_FILE ".linphone-zidcache"
#define CERTIFICATES_PATH ".linphone-usr-crt"
......@@ -165,7 +165,7 @@ char *linphone_gtk_get_config_file(const char *filename){
if (g_path_is_absolute(filename)) {
snprintf(config_file,path_max,"%s",filename);
} else{
#ifdef WIN32
#ifdef _WIN32
const char *appdata=getenv("APPDATA");
if (appdata){
snprintf(config_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
......@@ -194,7 +194,7 @@ static const char *linphone_gtk_get_factory_config_file(void){
if (progpath != NULL) {
char *basename;
progdir = strdup(progpath);
#ifdef WIN32
#ifdef _WIN32
basename = strrchr(progdir, '\\');
if (basename != NULL) {
basename ++;
......@@ -837,7 +837,7 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_
int i;
const char *ext="wav";
#ifdef WIN32
#ifdef _WIN32
loctime=*localtime(&curtime);
#else
localtime_r(&curtime,&loctime);
......@@ -1449,7 +1449,7 @@ void linphone_gtk_open_browser(const char *uri) {
g_warning("Could not open %s: %s", uri, error->message);
g_error_free(error);
}
#elif defined(WIN32)
#elif defined(_WIN32)
HINSTANCE instance = ShellExecute(NULL, "open", uri, NULL, NULL, SW_SHOWNORMAL);
if ((int)instance <= 32) {
g_warning("Could not open %s (error #%i)", uri, (int)instance);
......@@ -2068,7 +2068,7 @@ static void sigint_handler(int signum){
}
static void populate_xdg_data_dirs_envvar(void) {
#ifndef WIN32
#ifndef _WIN32
int i;
gchar *value;
gchar **paths;
......@@ -2125,7 +2125,7 @@ int main(int argc, char *argv[]){
if (!lang) lang = g_getenv("LANG");
}
if (lang && lang[0]!='\0'){
#ifdef WIN32
#ifdef _WIN32
if (strncmp(lang,"zh",2)==0){
workaround_gtk_entry_chinese_bug=TRUE;
}
......@@ -2143,7 +2143,7 @@ int main(int argc, char *argv[]){
#else
g_message("NLS disabled.\n");
#endif
#ifdef WIN32
#ifdef _WIN32
gtk_rc_add_default_file("./gtkrc");
#endif
gdk_threads_enter();
......
......@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <gtkosxapplication.h>
#endif
#if !defined(WIN32) && !defined(__APPLE__) && GLIB_CHECK_VERSION(2, 26, 0)
#if !defined(_WIN32) && !defined(__APPLE__) && GLIB_CHECK_VERSION(2, 26, 0)
#define STATUS_NOTIFIER_IS_USABLE 1
#endif
......
......@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphone.h"
#ifdef WIN32
#ifdef _WIN32
#include <wininet.h>
......
......@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#elif defined(WIN32)
#elif defined(_WIN32)
#include <gdk/gdkwin32.h>
#elif defined(__APPLE__)
extern void *gdk_quartz_window_get_nswindow(GdkWindow *window);
......@@ -103,7 +103,7 @@ static gboolean drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint
static void *get_native_handle(GdkWindow *gdkw){
#ifdef GDK_WINDOWING_X11
return (void *)GDK_WINDOW_XID(gdkw);
#elif defined(WIN32)
#elif defined(_WIN32)
return (void *)GDK_WINDOW_HWND(gdkw);
#elif defined(__APPLE__)
return (void *)gdk_quartz_window_get_nsview(gdkw);
......
mediastreamer2 @ 2900d2af
Subproject commit a3ef55cdb23f59600fe62d86f927d15754f5effd
Subproject commit 2900d2af5cedf1e8107bbb63291ddacf08d0a5c4
oRTP @ 140df465
Subproject commit b3d69baf234bb933fdd978cd9b132574f54e93ac
Subproject commit 140df4654b5bd9318273a6f08d1e0c0a2e639d43
......@@ -59,8 +59,6 @@ if(NOT IOS OR NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
endif()
endif()
add_definitions(-DBC_CONFIG_FILE="config.h")
if(IOS)
add_library(linphonetester STATIC ${SOURCE_FILES})
target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
......
......@@ -74,7 +74,7 @@ RCFILES = \
IMAGE_FILES = images/nowebcamCIF.jpg
COMMON_FILE = common/vcards.vcf common/thousand_vcards.vcf
VCARDS_FILE = vcards/vcards.vcf vcards/thousand_vcards.vcf
EXTRA_DIST = tester_hosts\
messages.db\
......@@ -83,7 +83,7 @@ EXTRA_DIST = tester_hosts\
$(CERTIFICATE_FILES)\
$(RCFILES)\
$(IMAGE_FILES)\
$(COMMON_FILE)
$(VCARDS_FILE)
if ENABLE_TESTS
......@@ -99,8 +99,8 @@ rcfilesdir = $(datadir)/liblinphone_tester/rcfiles
rcfiles_DATA = $(RCFILES)
imagesdir = $(datadir)/liblinphone_tester/images
images_DATA = $(IMAGE_FILES)
commondir = $(datadir)/liblinphone_tester/common
common_DATA = $(COMMON_FILE)
vcardsdir = $(datadir)/liblinphone_tester/vcards
vcards_DATA = $(VCARDS_FILE)
# there are 2 targets: liblinphonetester.la and the executable liblinphone_tester
......@@ -147,7 +147,7 @@ liblinphone_testerdir = $(datadir)/liblinphone_tester
dist_liblinphone_tester_DATA = tester_hosts messages.db
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi -I$(top_srcdir)/tester/common
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/coreapi
AM_CFLAGS = -DBC_CONFIG_FILE=\"config.h\" $(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) \
-DIN_LINPHONE $(ORTP_CFLAGS) $(MEDIASTREAMER_CFLAGS) $(BCTOOLBOXTESTER_CFLAGS) \
$(BELLESIP_CFLAGS) $(LIBXML2_CFLAGS) $(SQLITE3_CFLAGS) $(BELCARD_CFLAGS)
......
......@@ -32,7 +32,7 @@ static void linphone_vcard_import_export_friends_test(void) {
LinphoneCoreManager* manager = linphone_core_manager_new2("empty_rc", FALSE);
LinphoneFriendList *lfl = linphone_core_get_default_friend_list(manager->lc);
const MSList *friends = linphone_friend_list_get_friends(lfl);
char *import_filepath = bc_tester_res("common/vcards.vcf");
char *import_filepath = bc_tester_res("vcards/vcards.vcf");
char *export_filepath = create_filepath(bc_tester_get_writable_dir_prefix(), "export_vcards", "vcf");
int count = 0;
BC_ASSERT_EQUAL(ms_list_size(friends), 0, int, "%d");
......@@ -60,7 +60,7 @@ static void linphone_vcard_import_export_friends_test(void) {
static void linphone_vcard_import_a_lot_of_friends_test(void) {
LinphoneCoreManager* manager = linphone_core_manager_new2("empty_rc", FALSE);
LinphoneFriendList *lfl = linphone_core_get_default_friend_list(manager->lc);
char *import_filepath = bc_tester_res("common/thousand_vcards.vcf");
char *import_filepath = bc_tester_res("vcards/thousand_vcards.vcf");
clock_t start, end;
double elapsed = 0;
const MSList *friends = NULL;
......
......@@ -36,7 +36,7 @@ static bool_t dump_stats=FALSE;
static void stop(int signum){
running=FALSE;
}
#ifndef WIN32
#ifndef _WIN32
static void stats(int signum){
print_stats=TRUE;
}
......@@ -92,7 +92,7 @@ int main(int argc, char *argv[]){
policy.automatically_accept=TRUE;
signal(SIGINT,stop);
#ifndef WIN32
#ifndef _WIN32
signal(SIGUSR1,stats);
signal(SIGUSR2,dump_call_logs);
#endif
......
......@@ -23,9 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "generator.hh"
#ifdef WIN32
#ifdef _WIN32
#include <direct.h>
#include <filesystem>
#define strncasecmp _strnicmp
#endif
......@@ -45,7 +44,7 @@ CplusplusGenerator::CplusplusGenerator(){
void CplusplusGenerator::generate(Project *proj){
list<Class*> classes=proj->getClasses();
mCurProj=proj;
#ifndef WIN32
#ifndef _WIN32
mkdir(proj->getName().c_str(),S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IROTH);
#else
_mkdir(proj->getName().c_str());
......@@ -184,7 +183,7 @@ JavascriptGenerator::JavascriptGenerator(){
void JavascriptGenerator::generate(Project *proj){
list<Class*> classes=proj->getClasses();
mCurProj=proj;
#ifndef WIN32
#ifndef _WIN32
remove(to_lower(proj->getName()).c_str());
mkdir(to_lower(proj->getName()).c_str(),S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IROTH);
#else
......
......@@ -22,7 +22,7 @@ MSList * PyList_AsMSListOfString(PyObject *pyl) {
static void pylinphone_dispatch_messages(void) {
#ifdef WIN32
#ifdef _WIN32
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, 1)) {
TranslateMessage(&msg);
......
......@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "gitversion.h"
#ifdef WIN32
#ifdef _WIN32
#include <windows.h>
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment