Commit Graph

35 Commits

Author SHA1 Message Date
握猫猫
39fbd30513 Fix OSError errorCode field is not assigned a value (#22954)
In this PR, the following changes were made:
1. Replaced `raise newException(OSError, osErrorMsg(errno))` in batches
with `raiseOSError(errcode)`.
2. Replaced `newException(OSError, osErrorMsg(errno))` in batches with
`newOSError(errcode)`.

There are still some places that have not been replaced. After checking,
they are not system errors in the traditional sense.

```nim
proc dlclose(lib: LibHandle) =
  raise newException(OSError, "dlclose not implemented on Nintendo Switch!")
```

```nim
if not fileExists(result) and not dirExists(result):
  # consider using: `raiseOSError(osLastError(), result)`
  raise newException(OSError, "file '" & result & "' does not exist")
```

```nim
proc paramStr*(i: int): string =
  raise newException(OSError, "paramStr is not implemented on Genode")
```
2023-11-17 22:06:46 +01:00
ringabout
4d11d0619d complete std prefixes for stdlib (#22887)
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
2023-10-30 17:03:04 +01:00
konsumlamm
22776c410a Update documentation for dynlib (#17356)
* Update documentation for dynlib

* Apply suggestions

* Improve error handling in example
2021-07-26 19:15:21 -04:00
Emery Hemingway
8aa5991bea Genode platform fixes (#17521)
* Genode: move dyncall failures to runtime

Do not use the "error" pragma to warn that dynamic library loading is
not implemented, print a message at runtime and exit.

* Genode: use stricter dataspace type in page allocator

* Genode: remove compiler configuration from nim.cfg

Self-hosting Nim is not supported on Genode and defining the
cross-compilation environment can be done externally.

* Genode: use new mutex API

* Genode: call nim_component_construct as a C procedure

* Genode: implement echo for NimStringV2
2021-04-09 16:29:10 +02:00
Andrey Makarov
42687457b0 further progress on rst roles & directives (fix #17646) (#17659)
* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
2021-04-08 19:00:14 +02:00
konsumlamm
9819fb21d8 Use .. warning:: (#17320) 2021-03-10 10:39:23 -08:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
flywind
fcb5cf643c use single backtick (#17181) 2021-02-24 21:47:27 -08:00
Silvio
963db9e7da docs: dlimport -> dynlib (#15175) 2020-08-11 14:49:57 +02:00
narimiran
34d0be2ec1 [backport] run nimpretty on os-related stuff 2019-09-30 13:58:15 +02:00
Giovanni Petrantoni
2fdba334da Use proper types according to MSDN and fix clang build of windows dynlib (#11828) 2019-07-26 10:11:21 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
Jacek Sieka
9e7d885f35 dynlib: use posix module (#11623) 2019-07-08 09:14:35 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Araq
c3067e36bb newruntime: progress 2019-04-01 16:51:18 +02:00
Joey
559a7615ad Nintendo switch support (#8069)
* Add config section for Nintendo Switch
* Add compiler configuration for Nintendo Switch and it's CPU
* Add specific lib code for Nintendo Switch
* Add GC support for Nintendo Switch
* Update changelog for Nintendo Switch
* Update changelog with more info about fixed paths
* Cleaned up GC memory management a bit
* Relocate docs for Switch
* Rename aarch64NoneElfGcc to nintendoSwitchGCC
* Remove armv8a57
* Fix installer.ini
* Reuse code in linux and amd64
* Add posix defs for nintendo switch
* Add more defined sections for nintendo switch
* Remove old comment
* Add what's not supported for Nintendo Switch docs
* Make nintendoswitch == posix
* Remove DEVKITPRO references from nim.cfg
* Make PR extccomp changes
* Remove Result type alias
* Add separate switch consts file
* Update docs for nintendo switch
* Fix travis errors with undefined consts and add correct wait.h procs
2018-06-27 12:35:09 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Euan T
9e0e099cc0 Add an example to the dynlib module doc
Following a quesiton on Gitter about loading libraries dynamically based upon some runtime parameter, I noticed there's no documentation on the `dynlib` module for something that's quite common.
2018-03-21 10:30:58 +00:00
Yuriy Glukhov
a80a0972b7 Fixed dynlink with OpenSSL >1.1.0. Added loadLibPattern. 2016-11-30 17:16:54 +02:00
Konstantin Zaitsev
6f0cab7060 Added checks for CPP 2016-02-28 17:25:12 +06:00
Konstantin Zaitsev
2693179834 Fixed THINSTANCE declaration in dynlib.nim for VS compiler 2016-02-25 15:03:02 +06:00
Sergey Avseyev
f9d8d6ce09 Trim trailling spaces 2015-06-26 07:42:58 +03:00
Philip Witte
33e924a35c fixed poxix dynlib names for bigbreak 2014-09-04 21:38:45 -07:00
Araq
12d2a37519 more modules updated 2014-08-28 01:39:45 +02:00
Araq
11b6958755 big rename 2014-08-27 23:42:51 +02:00
Araq
2fc84325c7 should fix the nkExprColonExpr bug in the vm 2014-03-13 02:52:40 +01:00
Micky Latowicki
9ce775f468 dynlib: optionally pass RTLD_GLOBAL to dlopen 2014-02-10 09:30:21 +02:00
Araq
e647428539 case consistency for dynlib.nim 2014-02-02 00:01:33 +01:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
81b718641c small improvements for FFI 2012-12-26 22:48:34 +01:00
Araq
36efc380dd website improvements; better opengl wrapper (still broken) 2012-09-28 00:22:07 +02:00
Andreas Rumpf
40ea1d0330 fixed pango/pangoutils new wrappers 2010-02-26 01:26:16 +01:00
rumpf_a@web.de
40a5d6c3b9 continued work on html/xmlparser 2010-02-14 00:29:35 +01:00
Andreas Rumpf
66a7e3d37c added tools and web dirs 2009-09-15 23:22:22 +02:00
Andreas Rumpf
4d4b3b1c04 version0.7.10 2009-06-08 08:06:25 +02:00