kopia lustrzana https://gitlab.com/sane-project/backends
				
				
				
			Fix compile fail with connect() on OSX.
socket.h is being included on OSX currently and P5's static connect is conflicting with socket.h's connect(). Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>merge-requests/1/head
							rodzic
							
								
									3c21ae5f70
								
							
						
					
					
						commit
						bdc81be0da
					
				| 
						 | 
				
			
			@ -1,3 +1,8 @@
 | 
			
		|||
2010-04-08 Chris Bagwell <chris at cnpbagwell dot com>
 | 
			
		||||
	* backend/p5.c, backend/p5_device.c: Replace function
 | 
			
		||||
	name "connect" with something that conflicts with
 | 
			
		||||
	socket.h's connect().  Fixes compile fail on OSX 10.6.
 | 
			
		||||
 | 
			
		||||
2010-04-07 Chris Bagwell <chris at cnpbagwell dot com>
 | 
			
		||||
	* acinclude.m4: cygwin and mingw is now hiding M_PI_2
 | 
			
		||||
	defines with -ansi flag.  Remove to fix cygwin compile.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								backend/p5.c
								
								
								
								
							
							
						
						
									
										10
									
								
								backend/p5.c
								
								
								
								
							| 
						 | 
				
			
			@ -395,7 +395,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
      /* now try to connect to scanner */
 | 
			
		||||
      if (connect (device->fd) != SANE_TRUE)
 | 
			
		||||
      if (scanner_connect (device->fd) != SANE_TRUE)
 | 
			
		||||
	{
 | 
			
		||||
	  DBG (DBG_error, "sane_open: failed to connect!\n");
 | 
			
		||||
	  close_pp (device->fd);
 | 
			
		||||
| 
						 | 
				
			
			@ -1443,7 +1443,7 @@ sane_close (SANE_Handle handle)
 | 
			
		|||
	{
 | 
			
		||||
	  save_calibration (session->dev);
 | 
			
		||||
	}
 | 
			
		||||
      disconnect (session->dev->fd);
 | 
			
		||||
      scanner_disconnect (session->dev->fd);
 | 
			
		||||
      close_pp (session->dev->fd);
 | 
			
		||||
      session->dev->fd = -1;
 | 
			
		||||
      session->dev->initialized = SANE_FALSE;
 | 
			
		||||
| 
						 | 
				
			
			@ -2006,7 +2006,7 @@ probe (const char *devicename)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
  /* now try to connect to scanner */
 | 
			
		||||
  if (connect (fd) != SANE_TRUE)
 | 
			
		||||
  if (scanner_connect (fd) != SANE_TRUE)
 | 
			
		||||
    {
 | 
			
		||||
      DBG (DBG_error, "probe: failed to connect!\n");
 | 
			
		||||
      close_pp (fd);
 | 
			
		||||
| 
						 | 
				
			
			@ -2021,7 +2021,7 @@ probe (const char *devicename)
 | 
			
		|||
  write_reg (fd, REGF, 0x80);
 | 
			
		||||
  if (memtest (fd, 0x0100) != SANE_TRUE)
 | 
			
		||||
    {
 | 
			
		||||
      disconnect (fd);
 | 
			
		||||
      scanner_disconnect (fd);
 | 
			
		||||
      close_pp (fd);
 | 
			
		||||
      DBG (DBG_error, "probe: memory test failed!\n");
 | 
			
		||||
      return NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -2036,7 +2036,7 @@ probe (const char *devicename)
 | 
			
		|||
  test_document (fd);
 | 
			
		||||
 | 
			
		||||
  /* release device nd parport for next uses */
 | 
			
		||||
  disconnect (fd);
 | 
			
		||||
  scanner_disconnect (fd);
 | 
			
		||||
  close_pp (fd);
 | 
			
		||||
 | 
			
		||||
  /* for there is only one supported model, so we use hardcoded values */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -319,7 +319,7 @@ memtest (int fd, uint16_t addr)
 | 
			
		|||
 * @return SANE_TRUE in case of success, SANE_FALSE otherwise
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
connect (int fd)
 | 
			
		||||
scanner_connect (int fd)
 | 
			
		||||
{
 | 
			
		||||
  uint8_t val;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -388,7 +388,7 @@ connect (int fd)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
disconnect (int fd)
 | 
			
		||||
scanner_disconnect (int fd)
 | 
			
		||||
{
 | 
			
		||||
  uint8_t val;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue