removed ligcc.a dependency and fix problem with errno value
author'Gr?gory Tr?lat <gregory.trelat@lolitech.fr>'
Mon, 05 Oct 2009 11:35:40 +0200
changeset 598 fff217764431
parent 597 ea32aa303987
child 599 b2d2c3fab094
child 605 f91ee161b3a1
removed ligcc.a dependency and fix problem with errno value
drivers/can_peak_win32/can_peak_win32.c
examples/CANOpenShell/CANOpenShell.sln
examples/CANOpenShell/CANOpenShell.vcproj
--- a/drivers/can_peak_win32/can_peak_win32.c	Wed Sep 30 12:01:25 2009 +0200
+++ b/drivers/can_peak_win32/can_peak_win32.c	Mon Oct 05 11:35:40 2009 +0200
@@ -217,6 +217,7 @@
 UNS8 canSend_driver (CAN_HANDLE fd0, Message * m)
 {
 	UNS8 data;
+	DWORD localerrno;
 	TPCANMsg peakMsg;
 	peakMsg.ID = m->cob_id;	/* 11/29 bit code */
 	if (m->rtr == 0)
@@ -236,19 +237,19 @@
 		// if not the first handler
 		if(second_board == (s_BOARD *)fd0)
 		{
-			errno = CAN2_Write (&peakMsg);
+			errno = localerrno = CAN2_Write (&peakMsg);
 		}
 		else
 #endif
 		if(first_board == (s_BOARD *)fd0)
 			{
-				errno = CAN_Write (&peakMsg);
+				errno = localerrno = CAN_Write (&peakMsg);
 			}
 		else
 			goto fail;
-		if (errno)
-		{
-			if (errno == CAN_ERR_BUSOFF)
+		if (localerrno)
+		{
+			if (localerrno == CAN_ERR_BUSOFF)
 			{
 				printf ("!!! Peak board write : re-init\n");
 				canInit((s_BOARD*)fd0);
@@ -257,7 +258,7 @@
 			usleep (1000);
 		}
 	}
-	while (errno != CAN_ERR_OK);
+	while (localerrno != CAN_ERR_OK);
 #if defined DEBUG_MSG_CONSOLE_ON
 	MSG("out : ");
 	print_message(m);
--- a/examples/CANOpenShell/CANOpenShell.vcproj	Wed Sep 30 12:01:25 2009 +0200
+++ b/examples/CANOpenShell/CANOpenShell.vcproj	Mon Oct 05 11:35:40 2009 +0200
@@ -42,7 +42,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\include;..\..\include\win32"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
@@ -61,7 +61,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="&quot;..\..\lib\static\libcanfestival.lib&quot; &quot;..\..\lib\static\libcanfestival_win32.lib&quot; &quot;..\..\lib\static\libgcc.lib&quot;"
+				AdditionalDependencies="&quot;..\..\lib\static\libcanfestival.lib&quot; &quot;..\..\lib\static\libcanfestival_win32.lib&quot;"
 				LinkIncremental="2"
 				GenerateDebugInformation="false"
 				SubSystem="1"