[MacPorts] #55499: mingw-w64: missing secure api support

MacPorts noreply at macports.org
Tue Dec 12 08:51:24 UTC 2017


#55499: mingw-w64: missing secure api support
--------------------------+--------------------
  Reporter:  bruvzg       |      Owner:  mojca
      Type:  enhancement  |     Status:  closed
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:  fixed        |   Keywords:
      Port:  mingw-w64    |
--------------------------+--------------------

Comment (by bruvzg):

 Example:
 {{{
 #!c++
 #include <cstdio>

 int main( void ) {
         FILE *stream = NULL;
         errno_t err = fopen_s( &stream, "data", "w+" );
         if( err != 0 ) printf( "File 'data' was not opened\n" );
         if( stream ) fclose( stream );
 }
 }}}

 `x86_64-w64-mingw32-gcc fopen_s.cpp -o fopen_s.exe` without `--enable-
 secure-api` produce:
 {{{
 fopen_s.cpp: In function ‘int main()’:
 fopen_s.cpp:5:16: error: ‘fopen_s’ was not declared in this scope
   errno_t err = fopen_s( &stream, "data", "w+" );
                 ^~~~~~~
 fopen_s.cpp:5:16: note: suggested alternative: ‘fopen64’
   errno_t err = fopen_s( &stream, "data", "w+" );
                 ^~~~~~~
                 fopen64
 }}}
 Builds with `--enable-secure-api` or with explicitly declared
 `CXXFLAGS=-DMINGW_HAS_SECURE_API`.

 Actual project I had problems with: https://github.com/syoyo/tinyexr

--
Ticket URL: <https://trac.macports.org/ticket/55499#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list