• M
    Fix cast-function-type warning (#8230) · c2c7d5e9
    Mr-Leshiy 提交于
    Summary:
    Fixing cast-function-type which is appears during the following build:
    ```bash
    cmake ..  -DFAIL_ON_WARNINGS=ON -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_SYSTEM_NAME=Windows
    make rocksdb
    ```
    Here is the log:
    ```
    /home/leshiy/Work/rocksdb/port/win/env_win.cc: In constructor ‘rocksdb::port::WinClock::WinClock()’:
    /home/leshiy/Work/rocksdb/port/win/env_win.cc:92:9: error: cast between incompatible function types from ‘FARPROC’ {aka ‘long long int (*)()’} to ‘rocksdb::port::WinClock::FnGetSystemTimePreciseAsFileTime’ {aka ‘void (*)(_FILETIME*)’} [-Werror=cast-function-type]
       92 |         (FnGetSystemTimePreciseAsFileTime)GetProcAddress(
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       93 |             module, "GetSystemTimePreciseAsFileTime");
          |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors
    make[2]: *** [CMakeFiles/rocksdb.dir/build.make:4337: CMakeFiles/rocksdb.dir/port/win/env_win.cc.obj] Error 1
    make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/rocksdb.dir/all] Error 2
    make: *** [Makefile:91: all] Error 2
    ```
    
    Pull Request resolved: https://github.com/facebook/rocksdb/pull/8230
    
    Reviewed By: jay-zhuang
    
    Differential Revision: D28000215
    
    Pulled By: mrambacher
    
    fbshipit-source-id: 874782cf48f70470e3fbd9097585bf42e810ca61
    c2c7d5e9
env_win.cc 44.5 KB