Skip to content

Commit

Permalink
Fix(?) "warning: implicit declaration of function mlock" for non-Wind…
Browse files Browse the repository at this point in the history
…ows builds?

git-svn-id: file:///home/jj/hercules.svn/trunk@7301 956126f8-22a0-4046-8f4a-272fa8102e63
  • Loading branch information
Fish (David B Trout) committed Jan 27, 2011
1 parent d55b2e6 commit 5b46cfd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 50 deletions.
30 changes: 17 additions & 13 deletions herclin.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@
/* INTERFACE FEATURE. */
/************************************************/

#ifdef _MSVC_
#include <windows.h>
#include <conio.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hextapi.h"
#if 1 // fish test: we SHOULD be doing it this way! Why aren't we?!

#if defined(HDL_USE_LIBTOOL)
#include "hstdinc.h"
#include "hercules.h"

/* This must be included if HDL uses the */
/* libtool ltdl convenience library */
#else

#include "ltdl.h"
#endif
#ifdef _MSVC_
#include <windows.h>
#include <conio.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h> // Hercules build configuration options/settings
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>

#endif
#include "hextapi.h"

/**********************************************/
/* The following function is the LOG callback */
Expand Down
39 changes: 8 additions & 31 deletions hextapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,19 @@
/* (http://www.hercules-390.org/herclic.html) as modifications to */
/* Hercules. */

/********************************************************/
/* HEXTAPI.H : Definition of Hercules External (public) */
/* APIs */
/* (c) Copyright 2005-2009 Roger Bowler & Others */
/* This file originally written by Ivan Warren */
/* THE STATE OF THIS API IS NOT YET FINALIZED */
/* AND THEREFORE, THE INTERFACE MAY CHANGE */
/********************************************************/

// $Id$

/*
+-------------------------------------------------+
| This file originally written by Ivan Warren |
| THE STATE OF THIS API IS NOT YET FINALIZED |
| AND THEREFORE, THE INTERFACE MAY CHANGE |
+-------------------------------------------------+
*/

#ifndef _HEXTAPI_H_
#define _HEXTAPI_H_

#if defined(_MSVC_) && defined(HERC_DLL_BUILD)
#define DLL_IMPORT __declspec(dllimport)
#else
#define DLL_IMPORT extern
#endif

typedef void (*LOGCALLBACK)(const char *,size_t);
typedef void (*COMMANDHANDLER)(void *);

#ifdef __cplusplus
extern "C" {
#endif

/* LOG Callback */
DLL_IMPORT void registerLogCallback(LOGCALLBACK);
/* Panel Commands */
DLL_IMPORT COMMANDHANDLER getCommandHandler(void);
/* IMPL */
DLL_IMPORT int impl(int ac,char **av);
#ifdef __cplusplus
}
#endif
// ZZ FIXME: do we even NEED this header any longer?!

#endif
2 changes: 1 addition & 1 deletion hexterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ typedef void (*LOGCALLBACK)(const char *,size_t);
typedef void *(*COMMANDHANDLER)(void *);

IMPL_DLL_IMPORT int impl(int,char **);
IMPL_DLL_IMPORT void regiserLogCallback(LOGCALLBACK);
IMPL_DLL_IMPORT void registerLogCallback(LOGCALLBACK);
IMPL_DLL_IMPORT COMMANDHANDLER getCommandHandler(void);

/* Functions in module timer.c */
Expand Down
4 changes: 1 addition & 3 deletions hstdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#if !defined(_MSVC_)
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#endif
#include <sys/types.h>

Expand Down Expand Up @@ -114,9 +115,6 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions msvc.makefile.includes/MOD_RULES1.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ $(O)decNumber.res: decNumber\decNumber.rc
# No precompiled headers for these ones.. Sorry!
#
$(O)getopt.obj: getopt.c
$(cc) $(cdebug) $(cflags) $(cvarsdll) /Fo"$(OBJDIR)\\" /Fd"$(OBJDIR)\\" getopt.c
$(cc) $(cdebug) $(cflags) /IdecNumber /I. $(cvarsdll) /Fo"$(OBJDIR)\\" /Fd"$(OBJDIR)\\" getopt.c

$(O)herclin.obj: herclin.c
$(cc) $(cdebug) $(cflags) $(cvarsdll) /Fo"$(OBJDIR)\\" /Fd"$(OBJDIR)\\" herclin.c
$(cc) $(cdebug) $(cflags) /IdecNumber /I. $(cvarsdll) /Fo"$(OBJDIR)\\" /Fd"$(OBJDIR)\\" herclin.c

# NOTE: to be safe, since this member contains build rules, we need to
# make sure there's always a blank line following the last build rule
Expand Down

0 comments on commit 5b46cfd

Please sign in to comment.