ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
491 discussions
Start a n
N
ew thread
[tkreuzer] 49547: [CMAKE] - add importlib target for ntdll
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Nov 10 21:01:14 2010 New Revision: 49547 URL:
http://svn.reactos.org/svn/reactos?rev=49547&view=rev
Log: [CMAKE] - add importlib target for ntdll Modified: branches/cmake-bringup/dll/ntdll/CMakeLists.txt Modified: branches/cmake-bringup/dll/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/ntdll/CMakeLi…
============================================================================== --- branches/cmake-bringup/dll/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/dll/ntdll/CMakeLists.txt [iso-8859-1] Wed Nov 10 21:01:14 2010 @@ -55,4 +55,4 @@ add_minicd_target(ntdll reactos/system32 ntdll.dll) add_cab_target(ntdll 1) -add_importlib_target(${CMAKE_CURRENT_BINARY_DIR}/ntdll.def) +add_importlib_target(def/ntdll.spec)
14 years, 1 month
1
0
0
0
[jgardou] 49546: [STLPORT] - move headers to include directory - delete some incidentally committed things
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Nov 10 17:36:28 2010 New Revision: 49546 URL:
http://svn.reactos.org/svn/reactos?rev=49546&view=rev
Log: [STLPORT] - move headers to include directory - delete some incidentally committed things Added: branches/cmake-bringup/include/stlport/ - copied from r49543, branches/cmake-bringup/lib/3rdparty/stlport/stlport/ Removed: branches/cmake-bringup/lib/3rdparty/stlport/build/Makefiles/nmake/UpgradeLog.XML branches/cmake-bringup/lib/3rdparty/stlport/build/Makefiles/nmake/_UpgradeReport_Files/ branches/cmake-bringup/lib/3rdparty/stlport/stlport/ Modified: branches/cmake-bringup/CMakeMacros.cmake Modified: branches/cmake-bringup/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
============================================================================== --- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Wed Nov 10 17:36:28 2010 @@ -121,7 +121,7 @@ ENDMACRO(add_minicd) macro(set_cpp) - include_directories(BEFORE ${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport) + include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/stlport) set(IS_CPP 1) endmacro() Removed: branches/cmake-bringup/lib/3rdparty/stlport/build/Makefiles/nmake/UpgradeLog.XML URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/stlp…
============================================================================== --- branches/cmake-bringup/lib/3rdparty/stlport/build/Makefiles/nmake/UpgradeLog.XML [iso-8859-1] (original) +++ branches/cmake-bringup/lib/3rdparty/stlport/build/Makefiles/nmake/UpgradeLog.XML (removed) @@ -1,12 +1,0 @@ -<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog> -<Properties><Property Name="Solution" Value="targets"> -</Property><Property Name="Fichier solution" Value="D:\Programmation\reactos_cmake\lib\3rdparty\stlport\build\Makefiles\nmake\targets.sln"> -</Property><Property Name="Date" Value="vendredi 1 octobre 2010"> -</Property><Property Name="Time" Value="11:21:33"> -</Property></Properties><Event ErrorLevel="0" Project="targets" Source="targets.mak" Description="Converting project file 'D:\Programmation\reactos_cmake\lib\3rdparty\stlport\build\Makefiles\nmake\targets.mak'."> -</Event><Event ErrorLevel="2" Project="D:\Programmation\reactos_cmake\lib\3rdparty\stlport\build\Makefiles\nmake\targets.mak" Source="" Description="The following error has occurred during XML parsing:

File: D:\Programmation\reactos_cmake\lib\3rdparty\stlport\build\Makefiles\nmake\targets.mak
Line: 1
Column: 1
Error Message:
Syntaxe de document incorrecte.

The file 'D:\Programmation\reactos_cmake\lib\3rdparty\stlport\build\Makefiles\nmake\targets.mak' has failed to load."> -</Event><Event ErrorLevel="2" Project="targets" Source="targets.mak" Description="La balise de fin xs:choice ne correspond pas à la balise de début xs:sequence.
"> -</Event><Event ErrorLevel="2" Project="targets" Source="targets.mak" Description="La mise à niveau du projet a échoué."> -</Event><Event ErrorLevel="3" Project="targets" Source="targets.mak" Description="Non convertie"> -</Event><Event ErrorLevel="2" Project="" Source="targets.mak" Description="La mise à niveau du projet a échoué."> -</Event></UpgradeLog>
14 years, 1 month
1
0
0
0
[tkreuzer] 49545: [CMAKE] - Move spec2def into comppiler specific files, use spec2pdef tool on MSVC builds - Add a ridiculously complex macro to create the importlibs for MSVC. (It was hard for me ...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Nov 10 12:33:24 2010 New Revision: 49545 URL:
http://svn.reactos.org/svn/reactos?rev=49545&view=rev
Log: [CMAKE] - Move spec2def into comppiler specific files, use spec2pdef tool on MSVC builds - Add a ridiculously complex macro to create the importlibs for MSVC. (It was hard for me to figure this out, so be it for you ;-)) Modified: branches/cmake-bringup/CMakeMacros.cmake branches/cmake-bringup/gcc.cmake branches/cmake-bringup/msc.cmake Modified: branches/cmake-bringup/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
============================================================================== --- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Wed Nov 10 12:33:24 2010 @@ -1,4 +1,4 @@ - + MACRO(_PCH_GET_COMPILE_FLAGS _target_name _out_compile_flags _header_filename) # Add the precompiled header to the build @@ -40,16 +40,6 @@ DEPENDS ${_header_filename}) ENDMACRO(add_pch _target_name _header_filename _src_list) - -MACRO(spec2def _dllname _spec_file) - get_filename_component(_file ${_spec_file} NAME_WE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def - COMMAND native-winebuild -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def --def -E ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} --filename ${_dllname} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def - PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE) -ENDMACRO(spec2def _dllname _spec_file) if (NOT MSVC) MACRO(CreateBootSectorTarget _target_name _asm_file _object_file) @@ -116,85 +106,85 @@ ENDMACRO() MACRO(add_minicd_target _targetname _dir) # optional parameter: _nameoncd - if("${ARGN}" STREQUAL "") - get_target_property(FILENAME ${_targetname} LOCATION) - get_filename_component(_nameoncd ${FILENAME} NAME) - else() - set(_nameoncd ${ARGN}) - endif() - + if("${ARGN}" STREQUAL "") + get_target_property(FILENAME ${_targetname} LOCATION) + get_filename_component(_nameoncd ${FILENAME} NAME) + else() + set(_nameoncd ${ARGN}) + endif() + file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n") ENDMACRO(add_minicd_target) MACRO(add_minicd FILENAME _dir _nameoncd) file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n") ENDMACRO(add_minicd) - -macro(set_cpp) - include_directories(BEFORE ${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport) - set(IS_CPP 1) -endmacro() - + +macro(set_cpp) + include_directories(BEFORE ${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport) + set(IS_CPP 1) +endmacro() + MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd - if("${ARGN}" STREQUAL "") + if("${ARGN}" STREQUAL "") get_target_property(FILENAME ${_targetname} LOCATION) get_filename_component(_nameoncd ${FILENAME} NAME) else() set(_nameoncd ${ARGN}) - endif() - + endif() + file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n") -ENDMACRO(add_livecd_target) - -MACRO(add_livecd FILENAME _dir)# optional parameter : _nameoncd - if("${ARGN}" STREQUAL "") - get_filename_component(_nameoncd ${FILENAME} NAME) - else() - set(_nameoncd ${ARGN}) - endif() - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n") -ENDMACRO(add_livecd) - -macro(cab_to_dir _dir_num _var_name) -# 1 = system32 -# 2 = system32\drivers -# 3 = Fonts -# 4 = -# 5 = system32\drivers\etc -# 6 = inf -# 7 = bin -# 8 = media - if(${_dir_num} STREQUAL "1") - set(${_var_name} "reactos/system32") - elseif(${_dir_num} STREQUAL "2") - set(${_var_name} "reactos/system32/drivers") - elseif(${_dir_num} STREQUAL "3") - set(${_var_name} "reactos/fonts") - elseif(${_dir_num} STREQUAL "4") - set(${_var_name} "reactos") - elseif(${_dir_num} STREQUAL "5") - set(${_var_name} "reactos/system32/drivers/etc") - elseif(${_dir_num} STREQUAL "6") - set(${_var_name} "reactos/inf") - elseif(${_dir_num} STREQUAL "7") - set(${_var_name} "reactos/bin") - elseif(${_dir_num} STREQUAL "8") - set(${_var_name} "reactos/system32/drivers") - else() - message(FATAL_ERROR "Wrong directory ${_dir_num}") - endif() -endmacro() - -MACRO(add_cab_target _targetname _num ) - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt "${_targetname}\t${_num}\n") - cab_to_dir(${_num} _dir) - add_livecd_target(${_targetname} ${_dir}) -ENDMACRO(add_cab_target) - -MACRO(add_cab FILENAME _num) - file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt "${FILENAME}\t${_num}\n") - cab_to_dir(${_num} _dir) - add_livecd(${FILENAME} ${_dir}) +ENDMACRO(add_livecd_target) + +MACRO(add_livecd FILENAME _dir)# optional parameter : _nameoncd + if("${ARGN}" STREQUAL "") + get_filename_component(_nameoncd ${FILENAME} NAME) + else() + set(_nameoncd ${ARGN}) + endif() + file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n") +ENDMACRO(add_livecd) + +macro(cab_to_dir _dir_num _var_name) +# 1 = system32 +# 2 = system32\drivers +# 3 = Fonts +# 4 = +# 5 = system32\drivers\etc +# 6 = inf +# 7 = bin +# 8 = media + if(${_dir_num} STREQUAL "1") + set(${_var_name} "reactos/system32") + elseif(${_dir_num} STREQUAL "2") + set(${_var_name} "reactos/system32/drivers") + elseif(${_dir_num} STREQUAL "3") + set(${_var_name} "reactos/fonts") + elseif(${_dir_num} STREQUAL "4") + set(${_var_name} "reactos") + elseif(${_dir_num} STREQUAL "5") + set(${_var_name} "reactos/system32/drivers/etc") + elseif(${_dir_num} STREQUAL "6") + set(${_var_name} "reactos/inf") + elseif(${_dir_num} STREQUAL "7") + set(${_var_name} "reactos/bin") + elseif(${_dir_num} STREQUAL "8") + set(${_var_name} "reactos/system32/drivers") + else() + message(FATAL_ERROR "Wrong directory ${_dir_num}") + endif() +endmacro() + +MACRO(add_cab_target _targetname _num ) + file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt "${_targetname}\t${_num}\n") + cab_to_dir(${_num} _dir) + add_livecd_target(${_targetname} ${_dir}) +ENDMACRO(add_cab_target) + +MACRO(add_cab FILENAME _num) + file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt "${FILENAME}\t${_num}\n") + cab_to_dir(${_num} _dir) + add_livecd(${FILENAME} ${_dir}) ENDMACRO(add_cab) macro(custom_incdefs) @@ -251,8 +241,8 @@ get_filename_component(FILE ${_in_FILE} NAME_WE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c - COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl - DEPENDS ${_in_file}) + COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl + DEPENDS ${_in_file}) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c PROPERTIES GENERATED TRUE) @@ -261,8 +251,8 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c - COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl - DEPENDS ${_in_file}) + COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl + DEPENDS ${_in_file}) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c PROPERTIES GENERATED TRUE) @@ -271,16 +261,16 @@ endforeach(_in_FILE ${ARGN}) endmacro (MACRO_IDL_FILES) - -macro(ADD_TYPELIB TARGET) - custom_incdefs() - foreach(SOURCE ${ARGN}) - get_filename_component(FILE ${SOURCE} NAME_WE) - set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb - COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} - DEPENDS ${SOURCE}) - list(APPEND OBJECTS ${OBJECT}) - endforeach() - add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS}) -endmacro() + +macro(ADD_TYPELIB TARGET) + custom_incdefs() + foreach(SOURCE ${ARGN}) + get_filename_component(FILE ${SOURCE} NAME_WE) + set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb + COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} + DEPENDS ${SOURCE}) + list(APPEND OBJECTS ${OBJECT}) + endforeach() + add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS}) +endmacro() Modified: branches/cmake-bringup/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=495…
============================================================================== --- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Wed Nov 10 12:33:24 2010 @@ -158,6 +158,16 @@ # empty for now, while import libs are shipped endmacro() +MACRO(spec2def _dllname _spec_file) + get_filename_component(_file ${_spec_file} NAME_WE) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def + COMMAND native-winebuild -o ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def --def -E ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} --filename ${_dllname} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def + PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE) +ENDMACRO(spec2def _dllname _spec_file) + macro(pdef2def _pdef_file) get_filename_component(_file ${_pdef_file} NAME_WE) add_custom_command( Modified: branches/cmake-bringup/msc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=495…
============================================================================== --- branches/cmake-bringup/msc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/msc.cmake [iso-8859-1] Wed Nov 10 12:33:24 2010 @@ -56,6 +56,8 @@ endif() if (${TYPE} MATCHES win32gui) set_subsystem(${MODULE} windows) + set_entrypoint(${MODULE} WinMainCRTStartup) + target_link_libraries(${MODULE} mingw_common mingw_wmain) endif () if (${TYPE} MATCHES win32cui) set_subsystem(${MODULE} console) @@ -72,6 +74,7 @@ endif() target_link_libraries(${MODULE} mingw_common mingw_dllmain) add_importlibs(${MODULE} msvcrt kernel32) + add_linkerflag(${MODULE} "/DLL") endif() endmacro() @@ -89,20 +92,48 @@ #idl files support set(IDL_COMPILER midl) -set(IDL_FLAGS /win32) +set(IDL_FLAGS /win32 /Dstrict_context_handle=) set(IDL_HEADER_ARG /h) #.h set(IDL_TYPELIB_ARG /tlb) #.tlb set(IDL_SERVER_ARG /sstub) #.c for stub server library set(IDL_CLIENT_ARG /cstub) #.c for stub client library +# Thanks MS for creating a stupid linker +macro(add_importlib_target _spec_file) + get_filename_component(_name ${_spec_file} NAME_WE) -macro(add_importlib_target _def_file) - get_filename_component(_name ${_def_file} NAME_WE) + # Generate the asm stub file + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm + COMMAND native-spec2pdef -s ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}) + + # Generate a the export def file + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def + COMMAND native-spec2pdef -n -r ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}) + + # Assemble the file + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.obj + COMMAND ${CMAKE_ASM_COMPILER} /Fo${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.obj /c /Ta ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm + DEPENDS "${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm" + ) + + # Add neccessary importlibs for redirections + foreach(_lib ${ARGN}) + list(APPEND _libraries "${CMAKE_BINARY_DIR}/importlibs/${_lib}.lib") + endforeach() + + # Build the importlib add_custom_command( OUTPUT {CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib - COMMAND LINK /LIB /MACHINE:X86 /DEF:${_def_file} /OUT:${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib - DEPENDS ${_def_file} + COMMAND LINK /LIB /MACHINE:X86 /DEF:${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def /OUT:${CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.obj ${_libraries} + DEPENDS "${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.obj" "${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def" ${_libraries} ) + + # Add the importlib target add_custom_target( lib${_name} DEPENDS {CMAKE_BINARY_DIR}/importlibs/lib${_name}.lib @@ -115,6 +146,16 @@ add_dependencies(${MODULE} lib${LIB}) endforeach() endmacro() + +MACRO(spec2def _dllname _spec_file) + get_filename_component(_file ${_spec_file} NAME_WE) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def + COMMAND native-spec2pdef -n --dll ${_dllname} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file}.def + PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE) +ENDMACRO(spec2def _dllname _spec_file) macro(pdef2def _pdef_file) get_filename_component(_file ${_pdef_file} NAME_WE)
14 years, 1 month
1
0
0
0
[tkreuzer] 49544: [SPEC2PDEF] - Fix generation of asm stub file - add support for stripping the redirections - Use different error return values for debugging purpose - Misc fixes
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Nov 10 12:28:30 2010 New Revision: 49544 URL:
http://svn.reactos.org/svn/reactos?rev=49544&view=rev
Log: [SPEC2PDEF] - Fix generation of asm stub file - add support for stripping the redirections - Use different error return values for debugging purpose - Misc fixes Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2pdef/s…
============================================================================== --- branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] (original) +++ branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] Wed Nov 10 12:28:30 2010 @@ -17,6 +17,7 @@ int (*OutputLine)(FILE *, EXPORT *); void (*OutputHeader)(FILE *, char *); int no_decoration = 0; +int no_redirections = 0; enum { @@ -98,7 +99,7 @@ OutputHeader_stub(FILE *file, char *libname) { fprintf(file, "; File generated automatically, do not edit! \n\n" - ".code\n"); + ".586\n.model flat\n.code\n"); } int @@ -106,19 +107,19 @@ { if (pexp->nCallingConvention == CC_STDCALL) { - fprintf(fileDest, "PUBLIC _%.*s@%d\n_%.*s@%d:\n", + fprintf(fileDest, "PUBLIC _%.*s@%d\n_%.*s@%d: nop\n", pexp->nNameLength, pexp->pcName, pexp->nStackBytes, pexp->nNameLength, pexp->pcName, pexp->nStackBytes); } else if (pexp->nCallingConvention == CC_FASTCALL) { - fprintf(fileDest, "PUBLIC @%.*s@%d\n@%.*s@%d:\n", + fprintf(fileDest, "PUBLIC @%.*s@%d\n@%.*s@%d: nop\n", pexp->nNameLength, pexp->pcName, pexp->nStackBytes, pexp->nNameLength, pexp->pcName, pexp->nStackBytes); } else if (pexp->nCallingConvention == CC_CDECL) { - fprintf(fileDest, "PUBLIC _%.*s\n_%.*s:\n", + fprintf(fileDest, "PUBLIC _%.*s\n_%.*s: nop\n", pexp->nNameLength, pexp->pcName, pexp->nNameLength, pexp->pcName); } @@ -159,7 +160,7 @@ fprintf(fileDest, "@%d", exp->nStackBytes); } - if (exp->pcRedirection) + if (exp->pcRedirection && !no_redirections) { if (exp->nCallingConvention == CC_FASTCALL && !no_decoration) { @@ -273,16 +274,16 @@ if (*pc == '@') exp.nOrdinal = -1; else exp.nOrdinal = atol(pc); - /* Go to next token */ + /* Go to next token (type) */ if (!(pc = NextToken(pc))) { fprintf(stderr, "error: line %d, unexpected end of line\n", nLine); - return -1; + return -10; } //fprintf(stderr, "info: Token:'%.10s'\n", pc); - /* Now we should get the calling convention */ + /* Now we should get the type */ if (CompareToken(pc, "stdcall")) { exp.nCallingConvention = CC_STDCALL; @@ -297,24 +298,25 @@ { exp.nCallingConvention = CC_FASTCALL; } - else if (CompareToken(pc, "extern")) + else if (CompareToken(pc, "extern") || + CompareToken(pc, "stub")) { exp.nCallingConvention = CC_EXTERN; } else { - fprintf(stderr, "error: line %d, expected cc, got '%.*s' %d\n", + fprintf(stderr, "error: line %d, expected type, got '%.*s' %d\n", nLine, TokenLength(pc), pc, *pc); - return -1; + return -11; } //fprintf(stderr, "info: nCallingConvention: %d\n", exp.nCallingConvention); - /* Go to next token */ + /* Go to next token (options or name) */ if (!(pc = NextToken(pc))) { fprintf(stderr, "fail2\n"); - return -1; + return -12; } /* Handle options */ @@ -333,24 +335,23 @@ exp.pcName = pc; exp.nNameLength = TokenLength(pc); - /* Go to next token */ - if (!(pc = NextToken(pc))) - { - fprintf(stderr, "fail4\n"); - return -1; - } - /* Handle parameters */ exp.nStackBytes = 0; if (exp.nCallingConvention != CC_EXTERN) { //fprintf(stderr, "info: options:'%.10s'\n", pc); + /* Go to next token */ + if (!(pc = NextToken(pc))) + { + fprintf(stderr, "fail4\n"); + return -13; + } /* Verify syntax */ if (*pc++ != '(') { fprintf(stderr, "error: line %d, expected '('\n", nLine); - return -1; + return -14; } exp.nStackBytes = 0; @@ -371,7 +372,7 @@ if (!(pc = NextToken(pc))) { fprintf(stderr, "fail5\n"); - return -1; + return -15; } } @@ -379,7 +380,7 @@ if (*pc++ != ')') { fprintf(stderr, "error: line %d, expected ')'\n", nLine); - return -1; + return -16; } } @@ -393,7 +394,7 @@ if (NextToken(pc)) { fprintf(stderr, "error: line %d, additional tokens after ')'\n", nLine); - return -1; + return -17; } } else @@ -415,6 +416,7 @@ { printf("syntax: spec2pdef [<options> ...] <source file> <dest file>\n" "Possible options:\n" + " -d=<file> --dll=<file> names the dll\n" " -h --help prints this screen\n" " -s --stubs generates an asm lib stub\n" " -n --no-decoration removes @xx decorations from def file\n"); @@ -453,19 +455,22 @@ OutputLine = OutputLine_stub; OutputHeader = OutputHeader_stub; } - else if (_stricmp(argv[i], "--dll=") == 0) - { - pszDllName = argv[i] + 6; - } - else if (_stricmp(argv[i], "-d=") == 0) - { - pszDllName = argv[i] + 3; + else if ((_stricmp(argv[i], "--dll") == 0) || + (_stricmp(argv[i], "-d") == 0)) + { + pszDllName = argv[i + 1]; + i++; } else if ((_stricmp(argv[i], "--no-decoration") == 0) || (_stricmp(argv[i], "-n") == 0)) { no_decoration = 1; } + else if ((_stricmp(argv[i], "--no-redirection") == 0) || + (_stricmp(argv[i], "-r") == 0)) + { + no_redirections = 1; + } else { fprintf(stderr, "Unrecognized option: %s\n", argv[i]); @@ -480,12 +485,17 @@ int len; p1 = strrchr(argv[i], '\\'); - p2 = p1 = p1 ? p1 + 1 : argv[i + 1]; + if (!p1) p1 = strrchr(argv[i], '/'); + p2 = p1 = p1 ? p1 + 1 : argv[i]; /* walk up to '.' */ while (*p2 != '.' && *p2 != 0) p2++; len = p2 - p1; - if (len >= sizeof(achDllName) - 5) return -1; + if (len >= sizeof(achDllName) - 5) + { + fprintf(stderr, "name too long: %s\n", p1); + return -2; + } strncpy(achDllName, p1, len); strncpy(achDllName + len, ".dll", sizeof(achDllName) - len); @@ -497,7 +507,7 @@ if (!file) { fprintf(stderr, "error: could not open file %s ", argv[i]); - return -1; + return -3; } /* Get file size */ @@ -507,7 +517,7 @@ /* Allocate memory buffer */ pszSource = malloc(nFileSize + 1); - if (!pszSource) return -1; + if (!pszSource) return -4; /* Load input file into memory */ nFileSize = fread(pszSource, 1, nFileSize, file); @@ -521,13 +531,15 @@ if (!file) { fprintf(stderr, "error: could not open output file %s ", argv[i + 1]); - return -1; + return -5; } OutputHeader(file, pszDllName); result = ParseFile(pszSource, file); + if (OutputHeader == OutputHeader_stub) fprintf(file, "\nEND\n"); + fclose(file); return result;
14 years, 1 month
1
0
0
0
[tkreuzer] 49543: [MINGW] special stuff for MSVC
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Nov 9 20:43:09 2010 New Revision: 49543 URL:
http://svn.reactos.org/svn/reactos?rev=49543&view=rev
Log: [MINGW] special stuff for MSVC Added: branches/cmake-bringup/lib/3rdparty/mingw/mscmain.c (with props) Modified: branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt Modified: branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/ming…
============================================================================== --- branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt [iso-8859-1] Tue Nov 9 20:43:09 2010 @@ -18,7 +18,6 @@ CRT_glob.c crt_handler.c dllentry.c - gccmain.c gs_support.c merr.c mingw_helpers.c @@ -37,6 +36,12 @@ xtxtmode.c ofmt_stub.c cxa_pure_virtual.c) + +if(MSVC) +list(APPEND MINGW_COMMON_SOURCE mscmain.c) +else() +list(APPEND MINGW_COMMON_SOURCE gccmain.c) +endif() add_library(mingw_common ${MINGW_COMMON_SOURCE}) @@ -69,5 +74,5 @@ add_custom_target(oldnames ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/liboldnames.a) add_library(getopt getopt.c) -set_property(TARGET getopt PROPERTY COMPILE_DEFINITIONS _DLL __USE_CRTIMP) +set_property(TARGET getopt PROPERTY COMPILE_DEFINITIONS _DLL1 __USE_CRTIMP) add_dependencies(getopt psdk) Added: branches/cmake-bringup/lib/3rdparty/mingw/mscmain.c URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/ming…
============================================================================== --- branches/cmake-bringup/lib/3rdparty/mingw/mscmain.c (added) +++ branches/cmake-bringup/lib/3rdparty/mingw/mscmain.c [iso-8859-1] Tue Nov 9 20:43:09 2010 @@ -1,0 +1,49 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +#include <windows.h> +#include <stdlib.h> + +int _fltused; + +void +_cdecl +_alloca_probe_16(void) +{ +} + +void +__do_global_dtors (void) +{ + +} + +void +__do_global_ctors (void) +{ + +} + +BOOL +WINAPI +_CRT_INIT0(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + return TRUE; +} + +static int initialized = 0; + +void +__main (void) +{ + if (!initialized) + { + initialized = 1; + __do_global_ctors (); + } +} + + Propchange: branches/cmake-bringup/lib/3rdparty/mingw/mscmain.c ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 1 month
1
0
0
0
[tkreuzer] 49542: [SPEC2PDEF] - Add possibility to create def files with and without stdcall decoration and for an asm stub file. The asm stub file is neccessary for MSVC, as MSVC needs to actually...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Nov 9 20:04:20 2010 New Revision: 49542 URL:
http://svn.reactos.org/svn/reactos?rev=49542&view=rev
Log: [SPEC2PDEF] - Add possibility to create def files with and without stdcall decoration and for an asm stub file. The asm stub file is neccessary for MSVC, as MSVC needs to actually link a dll to be able to create the proper import lib. We can't use the one that is created when we create the actual dll target, because of circular dependencies. Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2pdef/s…
============================================================================== --- branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] (original) +++ branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] Tue Nov 9 20:04:20 2010 @@ -2,55 +2,6 @@ #include <stdlib.h> #include <ctype.h> #include <string.h> - -enum -{ - CC_STDCALL, - CC_CDECL, - CC_FASTCALL, - CC_EXTERN, -}; - -char* astrCallingConventions[] = -{ - "STDCALL", - "CDECL", - "FASTCALL", - "EXTERN" -}; - -int -_strcmpx(const char *string1, const char *string2) -{ - while (*string2) - { - if (*string1 != *string2) return (*string1 - *string2); - string1++; - string2++; - } - return 0; -} - -char * -NextLine(char *pc) -{ - /* Skip until the next line or EOF */ - while (*pc != '\n' && *pc != '\r' && *pc != 0) pc++; - if (*pc++ == '\r') pc++; - return pc; -} - -char * -NextToken(char *pc) -{ - /* Skip string */ - while (isprint(*pc) && !isspace(*pc)) pc++; - - /* Skip white spaces */ - while (*pc == ' ' || *pc == '\t') pc++; - - return pc; -} typedef struct { @@ -63,158 +14,160 @@ int nStackBytes; } EXPORT; -int -ParseLine(char* pcLine, int nLine, EXPORT *pexp) -{ - char *pcCurrent; - - //fprintf(stderr, "info: line %d, pcLine:'%.30s'\n", nLine, pcLine); - - pcCurrent = pcLine; - - /* skip white spaces */ - while (*pcCurrent == ' ') pcCurrent++; - - /* Check for line break */ - if (*pcCurrent == '\n' || *pcCurrent == '\r' || *pcCurrent == 0) return 0; +int (*OutputLine)(FILE *, EXPORT *); +void (*OutputHeader)(FILE *, char *); +int no_decoration = 0; + +enum +{ + CC_STDCALL, + CC_CDECL, + CC_FASTCALL, + CC_EXTERN, +}; + +char* astrCallingConventions[] = +{ + "STDCALL", + "CDECL", + "FASTCALL", + "EXTERN" +}; + +static +int +IsSeparator(char chr) +{ + return (chr <= '*' || chr == ';'); +} + +int +CompareToken(const char *token, const char *comparand) +{ + while (*comparand) + { + if (*token != *comparand) return 0; + token++; + comparand++; + } + if (!IsSeparator(*token)) return 0; + return 1; +} + +char * +NextLine(char *pc) +{ + while (*pc != 0) + { + if (pc[0] == '\n' && pc[1] == '\r') return pc + 2; + else if (pc[0] == '\n') return pc + 1; + pc++; + } + return pc; +} + +int +TokenLength(char *pc) +{ + int length = 0; + + while (!IsSeparator(*pc++)) length++; + + return length; +} + +char * +NextToken(char *pc) +{ + /* Skip token */ + while (!IsSeparator(*pc)) pc++; + + /* Skip white spaces */ + while (*pc == ' ' || *pc == '\t') pc++; + + /* Check for end of line */ + if (*pc == '\n' || *pc == '\r' || *pc == 0) return 0; /* Check for comment */ - if (*pcCurrent == '#' || *pcCurrent == ';') return 0; - - /* Now we should get either an ordinal or @ */ - if (*pcCurrent == '@') pexp->nOrdinal = -1; - else pexp->nOrdinal = atol(pcCurrent); - - /* Go to next token */ - pcCurrent = NextToken(pcCurrent); - - //fprintf(stderr, "info: Token:'%.10s'\n", pcCurrent); - - /* Now we should get the calling convention */ - if (_strcmpx(pcCurrent, "stdcall ") == 0) - { - pexp->nCallingConvention = CC_STDCALL; - } - else if ( (_strcmpx(pcCurrent, "cdecl ") == 0) || - (_strcmpx(pcCurrent, "varargs ") == 0) ) - { - pexp->nCallingConvention = CC_CDECL; - } - else if (_strcmpx(pcCurrent, "fastcall ") == 0 || - _strcmpx(pcCurrent, "FASTCALL ") == 0) - { - pexp->nCallingConvention = CC_FASTCALL; - } - else if (_strcmpx(pcCurrent, "extern ") == 0) - { - pexp->nCallingConvention = CC_EXTERN; - } - else - { - fprintf(stderr, "error: line %d, expected cc, got (%p) %d\n", nLine, pcCurrent, *pcCurrent); - return -1; - } - - //fprintf(stderr, "info: nCallingConvention: %d\n", pexp->nCallingConvention); - - /* Go to next token */ - pcCurrent = NextToken(pcCurrent); - - /* Handle option */ - while (*pcCurrent == '-') - { - fprintf(stderr, "info: got option: '%.10s'\n", pcCurrent); - // FIXME: handle options - - /* Go to next token */ - pcCurrent = NextToken(pcCurrent); - } - - //fprintf(stderr, "info: Name:'%.10s'\n", pcCurrent); - - /* Get name */ - pexp->pcName = pcCurrent; - while (isprint(*pcCurrent) && *pcCurrent != '(') pcCurrent++; - pexp->nNameLength = pcCurrent - pexp->pcName; - - /* Handle parameters */ - pexp->nStackBytes = 0; - if (pexp->nCallingConvention != CC_EXTERN) - { - //fprintf(stderr, "info: options:'%.10s'\n", pcCurrent); - - /* Syntax check */ - if (*pcCurrent++ != '(') - { - fprintf(stderr, "error: line %d, expected '('\n", nLine); - return -1; - } - - pexp->nStackBytes = 0; - while (isalpha(*pcCurrent)) - { - if (_strcmpx(pcCurrent, "long") == 0) - pexp->nStackBytes += 4; - else if (_strcmpx(pcCurrent, "double") == 0) - pexp->nStackBytes += 8; - else if (_strcmpx(pcCurrent, "ptr") == 0 || - _strcmpx(pcCurrent, "str") == 0 || - _strcmpx(pcCurrent, "wstr") == 0) - pexp->nStackBytes += sizeof(void*); - else - fprintf(stderr, "error: line %d, expected type, got: %.10s\n", nLine, pcCurrent); - - /* Go to next parameter */ - while (isalpha(*pcCurrent)) pcCurrent++; - while (isspace(*pcCurrent)) pcCurrent++; - } - - /* Check syntax */ - if (*pcCurrent++ != ')') - { - fprintf(stderr, "error: line %d, expected ')'\n", nLine); - return -1; - } - - /* Skip white spaces */ - while (*pcCurrent == ' ' || *pcCurrent == '\t') pcCurrent++; - } - - /* Get optional redirection */ - if (isprint(*pcCurrent)) - { - pexp->pcRedirection = pcCurrent; - while (isprint(*pcCurrent) && !isspace(*pcCurrent)) pcCurrent++; - pexp->nRedirectionLength = pcCurrent - pexp->pcRedirection; - } - else - { - pexp->pcRedirection = 0; - pexp->nRedirectionLength = 0; - } - + if (*pc == '#' || *pc == ';') return 0; + + return pc; +} + +void +OutputHeader_stub(FILE *file, char *libname) +{ + fprintf(file, "; File generated automatically, do not edit! \n\n" + ".code\n"); +} + +int +OutputLine_stub(FILE *fileDest, EXPORT *pexp) +{ + if (pexp->nCallingConvention == CC_STDCALL) + { + fprintf(fileDest, "PUBLIC _%.*s@%d\n_%.*s@%d:\n", + pexp->nNameLength, pexp->pcName, pexp->nStackBytes, + pexp->nNameLength, pexp->pcName, pexp->nStackBytes); + } + else if (pexp->nCallingConvention == CC_FASTCALL) + { + fprintf(fileDest, "PUBLIC @%.*s@%d\n@%.*s@%d:\n", + pexp->nNameLength, pexp->pcName, pexp->nStackBytes, + pexp->nNameLength, pexp->pcName, pexp->nStackBytes); + } + else if (pexp->nCallingConvention == CC_CDECL) + { + fprintf(fileDest, "PUBLIC _%.*s\n_%.*s:\n", + pexp->nNameLength, pexp->pcName, + pexp->nNameLength, pexp->pcName); + } + else if (pexp->nCallingConvention == CC_EXTERN) + { + fprintf(fileDest, "PUBLIC _%.*s\n_%.*s:\n", + pexp->nNameLength, pexp->pcName, + pexp->nNameLength, pexp->pcName); + } + return 1; } +void +OutputHeader_def(FILE *file, char *libname) +{ + fprintf(file, + "; File generated automatically, do not edit!\n\n" + "LIBRARY %s\n\n" + "EXPORTS\n", + libname); +} + int OutputLine_def(FILE *fileDest, EXPORT *exp) { fprintf(fileDest, " "); - if (exp->nCallingConvention == CC_FASTCALL) fprintf(fileDest, "@"); + if (exp->nCallingConvention == CC_FASTCALL && !no_decoration) + { + fprintf(fileDest, "@"); + } + fprintf(fileDest, "%.*s", exp->nNameLength, exp->pcName); - if (exp->nCallingConvention == CC_STDCALL || - exp->nCallingConvention == CC_FASTCALL) + if ((exp->nCallingConvention == CC_STDCALL || + exp->nCallingConvention == CC_FASTCALL) && !no_decoration) { fprintf(fileDest, "@%d", exp->nStackBytes); } if (exp->pcRedirection) { - if (exp->nCallingConvention == CC_FASTCALL) fprintf(fileDest, "@"); + if (exp->nCallingConvention == CC_FASTCALL && !no_decoration) + { + fprintf(fileDest, "@"); + } fprintf(fileDest, "=%.*s", exp->nRedirectionLength, exp->pcRedirection); - if (exp->nCallingConvention == CC_STDCALL || - exp->nCallingConvention == CC_FASTCALL) + if ((exp->nCallingConvention == CC_STDCALL || + exp->nCallingConvention == CC_FASTCALL) && !no_decoration) { fprintf(fileDest, "@%d", exp->nStackBytes); } @@ -235,39 +188,8 @@ return 1; } -int -OutputLine(FILE *fileDest, EXPORT *exp) -{ - fprintf(fileDest, "_NAME(%.*s,%s,%d)", - exp->nNameLength, exp->pcName, - astrCallingConventions[exp->nCallingConvention], - exp->nStackBytes); - - if (exp->pcRedirection) - { - fprintf(fileDest, "= _NAME(%.*s,%s,%d)", - exp->nRedirectionLength, exp->pcRedirection, - astrCallingConventions[exp->nCallingConvention], - exp->nStackBytes); - } - - if (exp->nOrdinal != -1) - { - fprintf(fileDest, " @%d", exp->nOrdinal); - } - - if (exp->nCallingConvention == CC_EXTERN) - { - fprintf(fileDest, " DATA"); - } - - fprintf(fileDest, "\n"); - - return 1; -} - void -OutputHeader(FILE *file, char *libname) +OutputHeader_pdef(FILE *file, char *libname) { fprintf(file, "; File generated automatically, do not edit!\n\n" @@ -288,74 +210,325 @@ libname); } +int +OutputLine_pdef(FILE *fileDest, EXPORT *exp) +{ + fprintf(fileDest, "_NAME(%.*s,%s,%d)", + exp->nNameLength, exp->pcName, + astrCallingConventions[exp->nCallingConvention], + exp->nStackBytes); + + if (exp->pcRedirection) + { + fprintf(fileDest, "= _NAME(%.*s,%s,%d)", + exp->nRedirectionLength, exp->pcRedirection, + astrCallingConventions[exp->nCallingConvention], + exp->nStackBytes); + } + + if (exp->nOrdinal != -1) + { + fprintf(fileDest, " @%d", exp->nOrdinal); + } + + if (exp->nCallingConvention == CC_EXTERN) + { + fprintf(fileDest, " DATA"); + } + + fprintf(fileDest, "\n"); + + return 1; +} + +int +ParseFile(char* pcStart, FILE *fileDest) +{ + char *pc, *pcLine; + int nLine; + EXPORT exp; + + //fprintf(stderr, "info: line %d, pcStart:'%.30s'\n", nLine, pcStart); + + /* Loop all lines */ + nLine = 1; + for (pcLine = pcStart; *pcLine; pcLine = NextLine(pcLine), nLine++) + { + pc = pcLine; + + //fprintf(stderr, "info: line %d, token:'%d, %.20s'\n", + // nLine, TokenLength(pcLine), pcLine); + + /* Skip white spaces */ + while (*pc <= ' ' && *pc != 0) pc++; + + /* Skip empty lines, stop at EOF */ + if (*pc == ';' || *pc <= '#') continue; + if (*pc == 0) return 0; + + //fprintf(stderr, "info: line %d, token:'%.*s'\n", + // nLine, TokenLength(pc), pc); + + /* Now we should get either an ordinal or @ */ + if (*pc == '@') exp.nOrdinal = -1; + else exp.nOrdinal = atol(pc); + + /* Go to next token */ + if (!(pc = NextToken(pc))) + { + fprintf(stderr, "error: line %d, unexpected end of line\n", nLine); + return -1; + } + + //fprintf(stderr, "info: Token:'%.10s'\n", pc); + + /* Now we should get the calling convention */ + if (CompareToken(pc, "stdcall")) + { + exp.nCallingConvention = CC_STDCALL; + } + else if (CompareToken(pc, "cdecl") || + CompareToken(pc, "varargs")) + { + exp.nCallingConvention = CC_CDECL; + } + else if (CompareToken(pc, "fastcall") || + CompareToken(pc, "FASTCALL")) + { + exp.nCallingConvention = CC_FASTCALL; + } + else if (CompareToken(pc, "extern")) + { + exp.nCallingConvention = CC_EXTERN; + } + else + { + fprintf(stderr, "error: line %d, expected cc, got '%.*s' %d\n", + nLine, TokenLength(pc), pc, *pc); + return -1; + } + + //fprintf(stderr, "info: nCallingConvention: %d\n", exp.nCallingConvention); + + /* Go to next token */ + if (!(pc = NextToken(pc))) + { + fprintf(stderr, "fail2\n"); + return -1; + } + + /* Handle options */ + while (*pc == '-') + { + fprintf(stderr, "info: got option: '%.10s'\n", pc); + // FIXME: handle options + + /* Go to next token */ + pc = NextToken(pc); + } + + //fprintf(stderr, "info: Name:'%.10s'\n", pc); + + /* Get name */ + exp.pcName = pc; + exp.nNameLength = TokenLength(pc); + + /* Go to next token */ + if (!(pc = NextToken(pc))) + { + fprintf(stderr, "fail4\n"); + return -1; + } + + /* Handle parameters */ + exp.nStackBytes = 0; + if (exp.nCallingConvention != CC_EXTERN) + { + //fprintf(stderr, "info: options:'%.10s'\n", pc); + + /* Verify syntax */ + if (*pc++ != '(') + { + fprintf(stderr, "error: line %d, expected '('\n", nLine); + return -1; + } + + exp.nStackBytes = 0; + while (*pc >= '0') + { + if (CompareToken(pc, "long")) + exp.nStackBytes += 4; + else if (CompareToken(pc, "double")) + exp.nStackBytes += 8; + else if (CompareToken(pc, "ptr") || + CompareToken(pc, "str") || + CompareToken(pc, "wstr")) + exp.nStackBytes += sizeof(void*); + else + fprintf(stderr, "error: line %d, expected type, got: %.10s\n", nLine, pc); + + /* Go to next parameter */ + if (!(pc = NextToken(pc))) + { + fprintf(stderr, "fail5\n"); + return -1; + } + } + + /* Check syntax */ + if (*pc++ != ')') + { + fprintf(stderr, "error: line %d, expected ')'\n", nLine); + return -1; + } + } + + /* Get optional redirection */ + if ((pc = NextToken(pc))) + { + exp.pcRedirection = pc; + exp.nRedirectionLength = TokenLength(pc); + + /* Check syntax (end of line) */ + if (NextToken(pc)) + { + fprintf(stderr, "error: line %d, additional tokens after ')'\n", nLine); + return -1; + } + } + else + { + exp.pcRedirection = 0; + exp.nRedirectionLength = 0; + } + + OutputLine(fileDest, &exp); + } + +printf("done\n"); + + return 0; +} + + void usage(void) { - printf("syntax: spec2pdef <source file> <dest file> <libname>\n"); + printf("syntax: spec2pdef [<options> ...] <source file> <dest file>\n" + "Possible options:\n" + " -h --help prints this screen\n" + " -s --stubs generates an asm lib stub\n" + " -n --no-decoration removes @xx decorations from def file\n"); } int main(int argc, char *argv[]) { size_t nFileSize; - char *pszSource, *pcLine; - int nLine, result; - FILE *fileSource, *fileDest; - EXPORT exp; - - if (argc < 4) + char *pszSource, *pszDllName = 0; + char achDllName[40]; + FILE *file; + int result, i; + + if (argc < 2) { usage(); - return 0; + return -1; + } + + /* Default to def file */ + OutputLine = OutputLine_def; + OutputHeader = OutputHeader_def; + + /* Read options */ + for (i = 1; i < argc && *argv[i] == '-'; i++) + { + if ((_stricmp(argv[i], "--help") == 0) || + (_stricmp(argv[i], "-h") == 0)) + { + usage(); + return 0; + } + else if ((_stricmp(argv[i], "--stublib") == 0) || + (_stricmp(argv[i], "-s") == 0)) + { + OutputLine = OutputLine_stub; + OutputHeader = OutputHeader_stub; + } + else if (_stricmp(argv[i], "--dll=") == 0) + { + pszDllName = argv[i] + 6; + } + else if (_stricmp(argv[i], "-d=") == 0) + { + pszDllName = argv[i] + 3; + } + else if ((_stricmp(argv[i], "--no-decoration") == 0) || + (_stricmp(argv[i], "-n") == 0)) + { + no_decoration = 1; + } + else + { + fprintf(stderr, "Unrecognized option: %s\n", argv[i]); + return -1; + } + } + + /* Set a default dll name */ + if (!pszDllName) + { + char *p1, *p2; + int len; + + p1 = strrchr(argv[i], '\\'); + p2 = p1 = p1 ? p1 + 1 : argv[i + 1]; + + /* walk up to '.' */ + while (*p2 != '.' && *p2 != 0) p2++; + len = p2 - p1; + if (len >= sizeof(achDllName) - 5) return -1; + + strncpy(achDllName, p1, len); + strncpy(achDllName + len, ".dll", sizeof(achDllName) - len); + pszDllName = achDllName; } /* Open input file argv[1] */ - fileSource = fopen(argv[1], "r"); - if (!fileSource) - { - fprintf(stderr, "error: could not open file %s ", argv[1]); + file = fopen(argv[i], "r"); + if (!file) + { + fprintf(stderr, "error: could not open file %s ", argv[i]); return -1; } /* Get file size */ - fseek(fileSource, 0, SEEK_END); - nFileSize = ftell(fileSource); - rewind(fileSource); + fseek(file, 0, SEEK_END); + nFileSize = ftell(file); + rewind(file); /* Allocate memory buffer */ pszSource = malloc(nFileSize + 1); if (!pszSource) return -1; /* Load input file into memory */ - nFileSize = fread(pszSource, 1, nFileSize, fileSource); + nFileSize = fread(pszSource, 1, nFileSize, file); + fclose(file); /* Zero terminate the source */ pszSource[nFileSize] = '\0'; - // open output file argv[2] - fileDest = fopen(argv[2], "w"); - if (!fileDest) - { - fprintf(stderr, "error: could not open output file %s ", argv[2]); + /* Open output file */ + file = fopen(argv[i + 1], "w"); + if (!file) + { + fprintf(stderr, "error: could not open output file %s ", argv[i + 1]); return -1; } - OutputHeader(fileDest, argv[3]); - - pcLine = pszSource; - for (nLine = 1; *pcLine != 0; pcLine = NextLine(pcLine), nLine++) - { - /* Parse the spec file line */ - result = ParseLine(pcLine, nLine, &exp); - - if (result == 1) - { - OutputLine(fileDest, &exp); - } - else if (result == -1) break; - - - } - - fclose(fileDest); - fclose(fileSource); - return 0; -} + OutputHeader(file, pszDllName); + + result = ParseFile(pszSource, file); + + fclose(file); + + return result; +}
14 years, 1 month
1
0
0
0
[sir_richard] 49541: [NTOS]: Fix bugs in MiAllocateContiguousPages. Fixes an ASSERT Caemyr was seeting a lot (the cont-able ASSERT).
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Nov 9 13:26:26 2010 New Revision: 49541 URL:
http://svn.reactos.org/svn/reactos?rev=49541&view=rev
Log: [NTOS]: Fix bugs in MiAllocateContiguousPages. Fixes an ASSERT Caemyr was seeting a lot (the cont-able ASSERT). Modified: trunk/reactos/ntoskrnl/mm/ARM3/contmem.c trunk/reactos/ntoskrnl/mm/ARM3/miarm.h Modified: trunk/reactos/ntoskrnl/mm/ARM3/contmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/contmem.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] Tue Nov 9 13:26:26 2010 @@ -30,13 +30,16 @@ ULONG i = 0; PMMPFN Pfn1, EndPfn; KIRQL OldIrql; - PAGED_CODE (); + PAGED_CODE(); ASSERT(SizeInPages != 0); // // Convert the boundary PFN into an alignment mask // BoundaryMask = ~(BoundaryPfn - 1); + + /* Disable APCs */ + KeEnterGuardedRegion(); // // Loop all the physical memory blocks @@ -69,12 +72,17 @@ // Now scan all the relevant PFNs in this run // Length = 0; - for (Pfn1 = MiGetPfnEntry(Page); Page < LastPage; Page++, Pfn1++) + for (Pfn1 = MI_PFN_ELEMENT(Page); Page < LastPage; Page++, Pfn1++) { // // If this PFN is in use, ignore it // - if (MiIsPfnInUse(Pfn1)) continue; + if (MiIsPfnInUse(Pfn1)) + { + //DPRINT1("In use: reset\n"); + Length = 0; + continue; + } // // If we haven't chosen a start PFN yet and the caller specified an @@ -86,6 +94,7 @@ // // It does not, so bail out // + //DPRINT1("Doesn't match restrictions: reset\n"); continue; } @@ -164,14 +173,17 @@ // Quick sanity check that the last PFN is consistent // EndPfn = Pfn1 + SizeInPages; - ASSERT(EndPfn == MiGetPfnEntry(Page + 1)); + ASSERT(EndPfn == MI_PFN_ELEMENT(Page + 1)); // // Compute the first page, and make sure it's consistent // - Page -= SizeInPages - 1; - ASSERT(Pfn1 == MiGetPfnEntry(Page)); + Page = Page - SizeInPages + 1; + ASSERT(Pfn1 == MI_PFN_ELEMENT(Page)); ASSERT(Page != 0); + + /* Enable APCs and return the page */ + KeLeaveGuardedRegion(); return Page; } Modified: trunk/reactos/ntoskrnl/mm/ARM3/miarm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/miarm.h?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] Tue Nov 9 13:26:26 2010 @@ -851,6 +851,18 @@ return ProtoPte; } +// +// Returns the PFN Database entry for the given page number +// Warning: This is not necessarily a valid PFN database entry! +// +FORCEINLINE +PMMPFN +MI_PFN_ELEMENT(IN PFN_NUMBER Pfn) +{ + /* Get the entry */ + return &MmPfnDatabase[Pfn]; +}; + BOOLEAN NTAPI MmArmInitSystem(
14 years, 1 month
1
0
0
0
[tkreuzer] 49540: [SPEC2PDEF] Handle varargs like cdecl
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Nov 9 13:07:59 2010 New Revision: 49540 URL:
http://svn.reactos.org/svn/reactos?rev=49540&view=rev
Log: [SPEC2PDEF] Handle varargs like cdecl Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2pdef/s…
============================================================================== --- branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] (original) +++ branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] Tue Nov 9 13:07:59 2010 @@ -95,7 +95,8 @@ { pexp->nCallingConvention = CC_STDCALL; } - else if (_strcmpx(pcCurrent, "cdecl ") == 0) + else if ( (_strcmpx(pcCurrent, "cdecl ") == 0) || + (_strcmpx(pcCurrent, "varargs ") == 0) ) { pexp->nCallingConvention = CC_CDECL; }
14 years, 1 month
1
0
0
0
[tkreuzer] 49539: [CABMAN] _strcmpi -> _stricmp
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Nov 9 08:58:09 2010 New Revision: 49539 URL:
http://svn.reactos.org/svn/reactos?rev=49539&view=rev
Log: [CABMAN] _strcmpi -> _stricmp Modified: branches/cmake-bringup/tools/cabman/cabinet.h Modified: branches/cmake-bringup/tools/cabman/cabinet.h URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/cabman/cabi…
============================================================================== --- branches/cmake-bringup/tools/cabman/cabinet.h [iso-8859-1] (original) +++ branches/cmake-bringup/tools/cabman/cabinet.h [iso-8859-1] Tue Nov 9 08:58:09 2010 @@ -29,7 +29,7 @@ #define DIR_SEPARATOR_CHAR '\\' #define DIR_SEPARATOR_STRING "\\" -#define strcasecmp _strcmpi +#define strcasecmp _stricmp #define strdup _strdup #define AllocateMemory(size) HeapAlloc(GetProcessHeap(), 0, size)
14 years, 1 month
1
0
0
0
[tkreuzer] 49538: [CMAKE] Add a hack to fix compilation of irot.idl with MSVC. If someone knows how to correctly fix this, please let me know.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Nov 9 01:42:06 2010 New Revision: 49538 URL:
http://svn.reactos.org/svn/reactos?rev=49538&view=rev
Log: [CMAKE] Add a hack to fix compilation of irot.idl with MSVC. If someone knows how to correctly fix this, please let me know. Modified: branches/cmake-bringup/toolchain-msvc.cmake Modified: branches/cmake-bringup/toolchain-msvc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-msvc.cm…
============================================================================== --- branches/cmake-bringup/toolchain-msvc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/toolchain-msvc.cmake [iso-8859-1] Tue Nov 9 01:42:06 2010 @@ -32,7 +32,7 @@ SET(CMAKE_IDL_COMPILER midl) SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> /I${REACTOS_SOURCE_DIR}/include/psdk /I${REACTOS_BINARY_DIR}/include/psdk /I${REACTOS_SOURCE_DIR}/include /I${REACTOS_SOURCE_DIR}/include/reactos /I${REACTOS_BINARY_DIR}/include/reactos /I${REACTOS_SOURCE_DIR}/include/reactos/wine /I${REACTOS_SOURCE_DIR}/include/crt /I${REACTOS_SOURCE_DIR}/include/crt/mingw32 /fo <OBJECT> <SOURCE>") -SET(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> /win32 /h <OBJECT> <SOURCE>") +SET(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> /win32 /Dstrict_context_handle= /h <OBJECT> <SOURCE>") SET(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_C_COMPILER> <FLAGS> <DEFINES> /D__ASM__ /D_USE_ML /EP /c <SOURCE> > <OBJECT>.tmp"
14 years, 1 month
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200