I have a Windows DLL that open parses Assembler SYSADATA using fopen and fread 
those api are there on XL. Rather than re-write the code (a I could use the 
functionality on the mainframe) I decided to upload it and compile it)

The first program or dll function is really simple all it does is open the 
file. Yet I am getting all sorts of errors from XL, and this is from standard 
headers such as builtin which I didn't even include

Here is my code. 

                                                                         
   #ifdef __MVS__                                                        
 #pragma options(RENT)                                                   
 #pragma export(openfile)                                                
 #else                                                                   
 #pragma warning(disable : 4700 )                                        
 // #include "stdafx.h"                                                  
  #include "windows.h"                                                   
  #include <winbase.h>                                                   
 #include "io.h"                                                         
 #include "fcntl.h"                                                      
  #include "sys\stat.h"                                                  
                                                                         
 #endif                                                                  
     #include "threadx.h"                                                    
  #include <stdio.h>                                                     
  #include <stdlib.h>                                                    
                                                                         
                                                                         
 #ifdef __MVS__                                                          
 #pragma CSECT(OPENFILE)                                                 
                                                                         
 #endif                                                                  
 #ifdef __MSVC__                                                         
 extern void bigedcpy(int *off, char *source, int num);                  
 extern "C" void ebcdicToAscii(unsigned char* s, int len);               
  extern  DWORD dwTlsIndex;                                              
 extern "C"                                                              
 {                                                                       
     __declspec(dllexport) bool openfile(char*);                         
 }                                                                       
#endif                                                                  
                                                                         
   bool openfile(char* filename)                                         
   {                                                                     
       LPVOID lpvData;                                                   
       LPDWORD lpFileSizeHigh;                                           
       procstor* procpointer;                                            
       DWORD filesize;                                                   
       /*   typedef void *(DLL_FN)(char *); */                           
      // DWORD dwTlsIndex;                                               
       lpvData = TlsGetValue(dwTlsIndex);                                
       procpointer = (procstor *)lpvData;                                
      procpointer->adataptr = fopen(filename, (const char *)"rb+");      
      if (procpointer->adataptr == NULL) 
         return FALSE;                                                  
#ifdef _MSVC_                                                           
     filesize = GetFileSize(procpointer->adataptr, lpFileSizeHigh);     
#endif                                                                  
      return TRUE;                                                      
  }     

   Here is my compile JCL
//JOER$ JOB 'ADCD V2R9','SYSPROG',NOTIFY=&SYSUID,REGION=0M             
//*                                                                    
//PREPROC  EXEC PGM=CCNDRVR,REGION=0M,                                 
// PARM=('/CXX PP(COMMENTS,NOLINES)')                                  
//STEPLIB  DD  DSNAME=CEE.SCEERUN2,DISP=SHR                            
//       DD  DSNAME=CBC.SCCNCMP,DISP=SHR                               
//       DD  DSNAME=CEE.SCEERUN,DISP=SHR                               
//SYSLIN   DD DUMMY                                                    
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSCPRT  DD  SYSOUT=*                                                
//SYSLIB   DD  DSN=JOER.TEST.SOURCE,DISP=SHR                           
//SYSUT1   DD  UNIT=SYSDA,SPACE=(32000,(30,30)),                       
//   DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)                              
//SYSUT5   DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT6   DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT7   DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT8   DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT9   DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=VB,LRECL=137,BLKSIZE=882)                     
//SYSUT10  DD DSN=JOER.CPP.SOURCE(OPENFILE),DISP=SHR                   
//SYSUT14  DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT16  DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSUT17  DD UNIT=SYSALLDA,SPACE=(32000,(30,30)),                     
//            DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)                  
//SYSIN    DD DSN=JOER.TEST.SOURCE(OPENFILE),DISP=SHR                  
//*                                                                             
                                                         
//COMPILE  EXEC PGM=CCNDRVR,REGION=0M,                                  
// PARM=('/CXX DLL(NOCBA),LIST(TEST.SYSPRINT(OPENFILE)),DEBUG(FORMAT(DW 
//             ARF),HOOK(LINE,NOBLOCK,PATH))')                          
//STEPLIB  DD DISP=SHR,DSN=CEE.SCEERUN2                                 
//         DD DISP=SHR,DSN=CBC.SCCNCMP                                  
//         DD DISP=SHR,DSN=CEE.SCEERUN     



  The errors are getting seem to be from standard headers.
"//'JOER.CPP.SOURCE(OPENFILE)'", line 184.4: CCN5063 (S) The text "extern" is un
"//'JOER.CPP.SOURCE(OPENFILE)'", line 554.43: CCN5063 (S) The text "size_t" is u
"//'JOER.CPP.SOURCE(OPENFILE)'", line 555.46: CCN5063 (S) The text "size_t" is u
"//'JOER.CPP.SOURCE(OPENFILE)'", line 556.52: CCN5063 (S) The text "size_t" is u


This points to first lines in stddef.h I tried compiling it a C taking CXX out 
but still get the errors.

000184    extern "C" {             
000185                             
000186    typedef  int ptrdiff_t;                                               
                                                                                
  
-----Original Message-----

From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
David Crayford
Sent: Monday, January 23, 2023 7:59 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: XL C++ compiler error message map template not included due to 
compiler version

On 23/1/23 22:29, Paul Gorlinsky wrote:
> C++ is an extension to C… staying current with Visual Studio releases will 
> help. Microsoft has been making lots of enhancements trying to catch up to 
> the current C/C++ standards.

I wouldn't use the full fat Visual Studio. Far better off using VS Code and the 
Windows port of clang. You will get IntelliSense and all the usual stuff that's 
useful + the clangd language server which will lint your code as you type.

I use the Windows Subsystem for Linux for all of my work bar Eclipse Plugins 
which I try and avoid anyway. All C/C++, Java, Python development is done using 
a Jetbrain's IDE connected to WSL using Linux binaries. IMO, using Windows to 
develop code to run on *nix systems isn't a very good idea now that WSL. 
PowerShell might be awesome for Windows weenies but I prefer the predictability 
of a UNIX shell like zsh or the venerable bash on old systems. It's remarkable 
how similar zCX containers are to WSL :)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu <mailto:lists...@listserv.ua.edu>  with the message: 
INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to