salut tout le monde ,
je veux compiler un repertoire (il contient des fichier .c et .pc) avec la commande make et j'ai l'erreur suivante
"uaeswitch_ini.c", line 35.13: 1506-275 (S) Unexpected text set encountered.
"uaeswitch_ini.c", line 35.4: 1506-045 (S) Undeclared identifier SIGSET_T.
"uaeswitch_ini.c", line 37.21: 1506-045 (S) Undeclared identifier set.
make: 1254-004 The error code from the last command is 1.
voila mon fichier uaeswitch_ini.c:
#include <uaeswitch.h>
static void sig_segment_violation(int sig);
static void sig_alarm(int sig);
static void GetGlobals (TSResources * P_sResource);
int ThreadMaskSignals()
{
SIGSET_T set;
if (sigemptyset(&set) < 0) {
fprintf(stderr, "Error when calling sigemptyset()\n");
fprintf(stdout, "End ThreadMaskSignal(FATAL)\n");
return (ERROR);
}
if (sigaddset(&set, SIGPIPE) < 0) {
fprintf(stderr, "Error when calling sigaddset(SIGPIPE)\n");
fprintf(stdout, "End ThreadMaskSignal(FATAL)\n");
return (ERROR);
}
if (sigaddset(&set, SIGCHLD) < 0) {
fprintf(stderr, "Error when calling sigaddset(SIGCHLD)\n");
fprintf(stdout, "End ThreadMaskSignal(FATAL)\n");
return (ERROR);
}
if (sigaddset(&set, SIGUSR2) < 0) {
fprintf(stderr, "Error when calling sigaddset(SIGUSR2)\n");
fprintf(stdout, "End ThreadMaskSignal(FATAL)\n");
return (ERROR);
}
#if defined(SOLARIS)
if (thr_sigsetmask(SIG_BLOCK, &set, NULL) < 0)
#elif defined(HPUX)
if (pthread_sigmask(SIG_BLOCK, &set, (SIGSET_T *)NULL) != 0)
#else
if (sigthreadmask(SIG_BLOCK, &set, NULL) < 0)
#endif
{
fprintf(stderr, "Error when calling sigaddset(SIG_BLOCK)\n");
fprintf(stdout, "End ThreadMaskSignal(FATAL)\n");
return (ERROR);
}
fprintf(stdout, "End ThreadMaskSignal(OK)\n");
return(OK);
}
int InitModule(char *P_szResourceId)
{
TSResources sResource;
char app_pid [9];
char app_ppid [9];
char sLine [ MAX_LINE_TRC ];
int result;
int flag_alarm=NOK;
/* - Inter-Process Communication Queue Opening ------------------------- */
if (( nBalMsg = OpenBalCom(BAL_MSG) ) < 0)
{
fprintf(stderr, "OpenBalCom(BAL_MSG) failed. \n");
return(ERROR);
}
EmptyQueue(nBalMsg, getpid());
/* - Administration Queue Opening -------------------------------------- */
if (( nBalAdm = OpenBalCom(BAL_ADM) ) < 0)
{
fprintf(stderr, "OpenBalCom(BAL_ADM) failed. \n");
return(ERROR);
}
EmptyQueue(nBalAdm, getpid());
/* - Administration Thread Creation ------------------------------------ */
if (pthread_create(&(tab_ThrInfo[ADM_THREAD_ID].tid), NULL, thread_ADMIN, NULL) < 0)
{
fprintf(stderr,"pthread_create Error %d\n", errno);
return(ERROR);
}
/* - Signal Management Thread Creation --------------------------------- */
if (pthread_create(&(tab_ThrInfo[SIG_THREAD_ID].tid), NULL, thread_SIG, NULL) < 0)
{
fprintf(stderr,"pthread_create Error %d\n", errno);
return(ERROR);
}
/* - Oracle Context Allocation & Database Connection ------------------- */
AllocateOracleCtx(MAIN_THREAD_ID);
if ( ConnectOracle (MAIN_THREAD_ID) != OK )
{
fprintf (stderr,"ConnectOracle() failed.\n");
return(ERROR);
}
/* - Getting Resource Parameters --------------------------------------- */
memset (sResource.resource_id, 0, 6);
memcpy (sResource.resource_id, P_szResourceId, 6);
if ( GetResources ( MAIN_THREAD_ID, &sResource) != OK)
{
fprintf (stderr,"GetResources() failed.\n");
DeconnectOracle(MAIN_THREAD_ID);
FreeOracleCtx(MAIN_THREAD_ID);
return(ERROR);
}
/* - Updating resource activity ---------------------------------------- */
if (ResourceActivity (MAIN_THREAD_ID, P_szResourceId, START) != OK)
{
fprintf (stderr,"Resources_Ativity table update failed.\n");
DeconnectOracle(MAIN_THREAD_ID);
FreeOracleCtx(MAIN_THREAD_ID);
return(ERROR);
}
/* fill-in all global variables from sResource */
GetGlobals(&sResource);
DumpGlobals();
/* Catching the segmentation violation signal */
/*install_handler(SIGSEGV, sig_segment_violation); */
install_handler(SIGQUIT, sig_segment_violation);
install_handler(SIGILL, sig_segment_violation);
install_handler(SIGTRAP, sig_segment_violation);
install_handler(SIGIOT, sig_segment_violation);
install_handler(SIGEMT, sig_segment_violation);
install_handler(SIGFPE, sig_segment_violation);
install_handler(SIGBUS, sig_segment_violation);
install_handler(SIGSYS, sig_segment_violation);
/* initialize trace */
if ( init_trace() != OK)
{
fprintf (stderr,"init_trace() failed.\n");
DeconnectOracle(MAIN_THREAD_ID);
FreeOracleCtx(MAIN_THREAD_ID);
return(ERROR);
}
trace_event ( "***************************************", PROCESSING );
trace_event ( "** New Session Started **", PROCESSING );
trace_event ( "***************************************", PROCESSING );
InitTabHsmCtx(VERIF_MODE);
memset (G_sUaeSwitch.F_szResourceStatus, 0, sizeof(G_sUaeSwitch.F_szResourceStatus));
/* - reset resource & get its internal id ------------------------------ */
if (ResetResource (MAIN_THREAD_ID, P_szResourceId, ResourceInternalId) != OK)
{
fprintf (stderr,"ResetResource() failed.\n");
DeconnectOracle(MAIN_THREAD_ID);
FreeOracleCtx(MAIN_THREAD_ID);
return (ERROR);
}
memcpy (G_sUaeSwitch.F_szResourceStatus, OFF, 3);
memcpy (sResource.pris_processing_step, OFF, 3);
memcpy (sResource.resource_live, CRITICAL, 1);
sprintf(app_pid, "%08d", getpid());
sprintf(app_ppid, "%08d", getppid());
LogEvent (MAIN_THREAD_ID, P_szResourceId, "", INTERFACE_START, "",
"", "", app_pid, app_ppid);
/* up to this point G_sUaeSwitch.F_szResourceStatus = OFF */
/* - Process shared entities initialisation ---------------------------- */
InitList();
InitTabAlarm();
InitBalProdConso();
InitLineProdConso();
InitTimeProdConso();
install_handler(SIGALRM, sig_alarm);
DeconnectOracle(MAIN_THREAD_ID);
FreeOracleCtx(MAIN_THREAD_ID);
return(OK);
}
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*> Module Private Methods >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
static void sig_segment_violation(int X)
{
char szDetail[80];
sprintf(szDetail, "SEGV : %d, X=%d\n", pthread_self(), X);
trace_event(szDetail, ERROR);
pthread_kill(tab_ThrInfo[SIG_THREAD_ID].tid, SIGUSR2);
sleep(10);
}
static void sig_alarm(int X)
{
char szDetail[80];
sprintf(szDetail, "TIMEOUT : %d\n", pthread_self());
trace_event(szDetail, ERROR);
}
static void GetGlobals (TSResources *P_sResource)
{
/* dump variables */
memcpy (trace_file, P_sResource->pris_log_file_name, 20);
max_size = P_sResource->pris_log_max_size;
trace_level = atoi (P_sResource->pris_trace_level);
/* communication variables */
memset (CommsId, 0, sizeof(CommsId));
memcpy (CommsId, P_sResource->pris_comms_id, 2);
memset (ProtocolId, 0, sizeof(ProtocolId));
memcpy (ProtocolId, P_sResource->pris_protocol_id, 2);
memset (DeviceName, 0, sizeof(DeviceName));
memcpy (DeviceName, P_sResource->pris_device_name,
strlen(P_sResource->pris_device_name));
memset (RemoteAppName, 0, sizeof(RemoteAppName));
memcpy (RemoteAppName, P_sResource->pris_remote_application_name,
strlen(P_sResource->pris_remote_application_name));
memset (RemoteAppId, 0, sizeof(RemoteAppId));
memcpy (RemoteAppId, P_sResource->pris_remote_application_id,
strlen(P_sResource->pris_remote_application_id));
memset (LocalAppName, 0, sizeof(LocalAppName));
memcpy (LocalAppName, P_sResource->pris_local_application_name,
strlen(P_sResource->pris_local_application_name));
memset (LocalAppId, 0, sizeof(LocalAppId));
memcpy (LocalAppId, P_sResource->pris_local_application_id,
strlen(P_sResource->pris_local_application_id));
/* purge time variables */
nTimerAcq = P_sResource->pris_timer_acquirer;
nIssAcqDelta = P_sResource->pris_delta_timer_iss_acq;
/* troubelshoot indicators */
MinTroublesInd = P_sResource->pris_min_troubles_ind;
MaxTroublesInd = P_sResource->pris_max_troubles_ind;
max_thread = P_sResource->pris_nb_static_threads;
nUserThread = P_sResource->pris_nb_user_threads_vs_kernel;
max_request = max_thread * 20;
memcpy (AcquirerBank, P_sResource->pris_bank_code, 6);
G_sUaeSwitch.F_nEchoTestPeriod = P_sResource->pris_echo_test_timer ;
}
et mon fichier Makefile :
include $(HOME_ENV_MAKEFILE)/env_precomp.mk
LIBSSPEC =-lm -lprocessing -lutils -lndcutil -latm -lprivtlv -lsaf -lhsmtdes -lauthotlv -lprodtlv -lstatement -lnetuaeswitch -luaeswitch -lpsms -lpcps -lpsmspuf -lppuf
TARGET =UAESWITCH
INCSPEC =$(HOME)/src/interfaces/uaeswitch/inc
#DEST =-o $(BIN)/$(TARGET)
all : $(TARGET)
OBJS = uaeswitch_main.o uaeswitch_ini.o uaeswitch_params.o\
uaeswitch_net_mng.o\
uaeswitch_tool_kit.o\
uaeswitch_thread_adm.o uaeswitch_process_adm.o uaeswitch_services.o uaeswitch_shutdown.o\
uaeswitch_thread_bal.o uaeswitch_process_bal.o\
uaeswitch_thread_line.o uaeswitch_process_line.o\
uaeswitch_thread_timeout.o uaeswitch_process_timeout.o\
uaeswitch_thread_saf.o uaeswitch_process_saf.o uaeswitch_process_signin.o\
uaeswitch_thread_sig.o uaeswitch_thread_signin.o\
uaeswitch_thread_ctl.o \
uaeswitch_trn_processing.o \
uaeswitch_rev_processing.o \
uaeswitch_rec_processing.o \
uaeswitch_rev_resp_code.o \
uaeswitch_tools_reply.o \
uaeswitch_keys.o \
$(NULL)
#
# Precompilation de Por*C
#
.pc.o:
$(PROC) $(PROCPLSFLAGS) $(PROCPPFLAGS) include=$(INCSPEC) iname=$* ireclen=132
$(CC) -I$(INCSPEC) $*.c
#
# Generation des objets
#
.c.o :
$(CC) -I$(INCSPEC) $<
#
# Target Generation Rule
#
$(TARGET) : $(OBJS)
$(GCC) $(OBJS) $(LIBS) $(LIBSSPEC) -o $(BIN)/$(TARGET)
clean :
rm -f $(DEST)/$(TARGET) $(SRC_OBJ)
merci pour votre aide
Partager